FlexiAI Toolsmith is a flexible, multi-channel Python framework for building AI-powered chat assistants. It supports both CLI and web (Quart + SSE) interfaces, integrates with multiple AI providers via the OpenAI Python SDK, and enables assistants to invoke powerful tool plug-ins—including CSV / spreadsheet processing, YouTube search, security audits, dynamic forms, and (soon) OCR.
Provider Support Overview
- ✅ OpenAI and Azure OpenAI — full Assistant-API support
- 🟡 DeepSeek and Qwen — OpenAI SDK, but chat-completions only for now
- ❌ GitHub Azure Inference — chat-completions only
⚙️ When any SDK-backed provider adds Assistant-API support, FlexiAI Toolsmith will pick it up automatically—no code changes required.
- Features
- Tutorials / Quick Demos
- Architecture
- Prerequisites
- Installation
- Configuration
- Usage
- Contributing
- License
Chat events can be streamed to:
- CLI (
CLIChannel) - Redis Pub/Sub (
RedisChannel) - SSE Web clients via Quart (
QuartChannel+SSEManager)
- OpenAI & Azure OpenAI — full Assistant-API (threads, deltas, tool calls)
- DeepSeek & Qwen — chat-completions via OpenAI SDK (Assistant-API pending)
- GitHub Azure Inference — chat-completions only
- Thread life-cycle management (create → queue → in-progress → complete)
- Event routing via in-memory
EventBus+EventDispatcher - Delta-based message streaming with
MessageDeltaEvent
Toolsmith lets assistants invoke dynamic tools via tool calls, giving you a hybrid RAG + MAS system:
- Agent coordination & delegation
save_processed_content/load_processed_contentinitialize_agent/communicate_with_assistant
- YouTube Search —
search_youtube,search_on_youtube - Product Filtering —
filter_products(ai_custom_products) - CSV Operations —
csv_operations(CRUD) - Subscriber Management —
identify_subscriber,retrieve_billing_details,manage_services - Spreadsheet Operations —
file_operations,sheet_operations,data_entry_operations, … - Security Audits —
security_audit(recon, port scans, defenses, updates) - Web Forms (Experimental) — Generates interactive forms as Markdown in the Quart/SSE chat UI; submissions are sent via a POST to
/submit_user_infoand persisted to CSV - OCR (Coming Soon) —
flexiai/toolsmith/_recycle/OCR.py
- Pydantic-based
.envfor credentials, channels, logging, … - Modular factories for channels, credentials, handlers, tools
- Structured logging with rotating file + console outputs
📦 flexiai-toolsmith
┣ 📂 flexiai
┃ ┣ 📂 channels
┃ ┣ 📂 config
┃ ┣ 📂 controllers
┃ ┣ 📂 core
┃ ┃ ┣ 📂 events
┃ ┃ ┗ 📂 handlers
┃ ┣ 📂 credentials
┃ ┣ 📂 database
┃ ┣ 📂 toolsmith
┃ ┗ 📂 utils
┣ 📂 static
┣ 📂 templates
┣ 📜 .env
┣ 📜 .env.template
┣ 📜 .gitignore
┣ 📜 app.py
┣ 📜 chat.py
┣ 📜 environment.yml
┣ 📜 requirements.in
┗ 📜 requirements.txt
- Python 3.12+
- Redis (if
redisinACTIVE_CHANNELS) - Conda (Miniconda/Anaconda) or
pip+venv
-
Clone the repository
git clone https://github.com/SavinRazvan/flexiai-toolsmith.git
-
Set up the environment (Conda recommended)
conda env create -f environment.yml conda activate .conda_flexiai
Or use
venv+pip:python -m venv .venv source .venv/bin/activate pip install -r requirements.txt
Copy .env.template ➜ .env, then edit:
| Variable | Description | Example |
|---|---|---|
CREDENTIAL_TYPE |
openai, azure, deepseek, qwen, github_models |
openai |
OPENAI_API_KEY, … |
Provider credentials | sk-… |
ACTIVE_CHANNELS |
cli, redis, quart (comma-separated) |
cli,quart |
USER_PROJECT_ROOT_DIR |
Absolute project root path | /home/user/code |
YOUTUBE_API_KEY (opt.) |
Needed for YouTube search tool | AIza… |
ℹ️ Assistant-API features currently work on OpenAI & Azure OpenAI only; DeepSeek & Qwen auto-enable once their endpoints support it.
python chat.py- Prompts show as
👤 You - Assistant messages stream as
🌺 Assistant
hypercorn app:app --bind 127.0.0.1:8000 --workers 1- Browse to http://127.0.0.1:8000/chat/
- Start chatting in the live SSE UI
You can run FlexiAI Toolsmith in a container without installing Python or dependencies on your host.
docker build -t flexiai-toolsmith .docker run -p 8000:8000 flexiai-toolsmithThe web interface will be available at http://localhost:8000/chat/.
Note:
Make sure your.envfile is present in the project root before building the image.
For production, consider usinghypercornas the entrypoint.
-
Fork ➜ create a feature branch
git checkout -b feature/my-feature
-
Commit with clear messages
-
Open a pull request explaining context & purpose
Released under the MIT License — see LICENSE for full terms.