This guide will help you set up the development environment for FlexiAI Toolsmith.
- Python 3.12+ (Python 3.13 is also supported)
- Conda (Miniconda/Anaconda) - optional but recommended
- Tesseract OCR - optional, only needed for OCR features
- Ubuntu/Debian:
sudo apt-get install tesseract-ocr - macOS:
brew install tesseract - Windows: Download from GitHub
- Ubuntu/Debian:
- Redis - optional, only needed if using Redis channel
- Ubuntu/Debian:
sudo apt-get install redis-server - macOS:
brew install redis - Or use Docker:
docker run -d -p 6379:6379 redis
- Ubuntu/Debian:
Run the setup script:
./setup_env.shThe script will:
- Check Python version
- Ask if you want to use Conda (if available)
- Create the environment (Conda or venv)
- Create
.envfile from template - Provide activation instructions
# Create conda environment
conda env create -f environment.yml
# Activate environment
conda activate .conda_flexiai# Create virtual environment
python3 -m venv .venv
# Activate environment
source .venv/bin/activate # On Linux/Mac
# OR
.venv\Scripts\activate # On Windows
# Install dependencies
pip install -r requirements.txtCopy the template:
cp .env.template .envOpen .env and configure the following required settings:
# Choose your AI provider
CREDENTIAL_TYPE=openai # Options: openai, azure, deepseek, qwen, github_models
# Get this from your OpenAI/Azure dashboard
ASSISTANT_ID=your_assistant_id_here
# User identifier
USER_ID=default_user
# Active channels (comma-separated)
ACTIVE_CHANNELS=cli,quart # Options: cli, redis, quartFor OpenAI:
OPENAI_API_KEY=sk-your-openai-api-key-hereFor Azure OpenAI:
AZURE_OPENAI_API_KEY=your-azure-api-key-here
AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com/For DeepSeek:
DEEPSEEK_API_KEY=your-deepseek-api-key-hereFor Qwen:
QWEN_API_KEY=your-qwen-api-key-hereFor GitHub Azure Inference:
GITHUB_TOKEN=your-github-token-here# YouTube API Key (for YouTube search tool)
YOUTUBE_API_KEY=your-youtube-api-key
# Redis URL (if using Redis channel)
REDIS_URL=redis://localhost:6379/0
# Database URL (defaults to SQLite if not set)
DATABASE_URL=
# Secret key for Quart sessions
SECRET_KEY=your-secret-key-herepython --version
# Should show Python 3.12 or higher# Basic dependencies
python -c "import quart; import openai; import pydantic_settings; print('✓ Core dependencies OK')"
# Optional: Verify hypercorn (for web server)
python -c "import hypercorn; print('✓ Hypercorn OK')"
# Optional: Verify OCR support (if tesseract is installed)
python -c "import pytesseract; print('✓ OCR support available')" 2>/dev/null || echo "⚠️ OCR not available (tesseract not installed)"python chat.pyhypercorn app:app --bind 127.0.0.1:8000 --workers 1Then open: http://127.0.0.1:8000/chat/
Solution: Install Python 3.12+ from python.org or use conda:
conda install python=3.12Solution: Reinstall requirements:
# Make sure venv is activated
source .venv/bin/activate # or conda activate .conda_flexiai
# Upgrade pip first
pip install --upgrade pip
# Install all dependencies
pip install -r requirements.txtNote: If you're using Conda, dependencies are installed automatically with conda env create -f environment.yml.
Solution:
- Install Redis:
- Linux:
sudo apt-get install redis-server - macOS:
brew install redis - Docker:
docker run -d -p 6379:6379 redis
- Linux:
- Or remove
redisfromACTIVE_CHANNELSin.env
Solution:
- Install Tesseract OCR:
- Ubuntu/Debian:
sudo apt-get install tesseract-ocr - macOS:
brew install tesseract - Windows: Download from GitHub
- Ubuntu/Debian:
- OCR features are optional and only needed if you use OCR tools
Solution: Make sure your virtual environment is activated:
# Check if activated (should show your venv path)
which python
# If not activated, activate it
source .venv/bin/activate # or conda activate .conda_flexiaiSolution:
- Verify your
.envfile exists and contains the correct API keys - Check that
CREDENTIAL_TYPEmatches your provider - Ensure no extra spaces or quotes around values in
.env
- The
.envfile is git-ignored for security - Always use
.env.templateas a reference - For production, use strong
SECRET_KEYvalues - Redis is optional unless you're using the Redis channel
After completing setup, you should be able to run the application. Here's what to expect:
When you run python chat.py, you should see an interactive CLI chat interface:
When you start the web server and navigate to http://127.0.0.1:8000/chat/, you should see:
Both interfaces support real-time streaming responses and tool execution.
- ✅ Environment set up
- ✅
.envconfigured - 🚀 Run the application
- 📖 Read the main README.md for usage details
.png)
