An enhanced Open Interpreter fork with robust Open WebUI integration and advanced computer control capabilities
The_Colonel is a powerful, battle-tested fork of Open Interpreter designed for serious automation and AI-powered computer control. With comprehensive Open WebUI integration, advanced streaming capabilities, and robust error handling, it bridges the gap between conversational AI and practical system automation.
- π Seamless Open WebUI Integration: Production-ready API server with OpenAI-compatible streaming endpoints
- π οΈ Comprehensive Tool Arsenal: 12+ specialized endpoints for code execution, file operations, and computer control
- π₯οΈ Advanced Computer Control: Direct mouse/keyboard interaction, screenshots, and window management
- π Intelligent File Management: Advanced file operations with upload/download capabilities
- π€ Dynamic Profile System: Hot-swappable configurations for different AI models and use cases
- π Enterprise-Ready Security: Bearer token authentication with localhost development mode
- β‘ Optimized Streaming: Robust chunk processing with real-time response streaming
- π§ Error-Resilient Architecture: Advanced error handling and recovery mechanisms
- π OpenAPI 3.1 Specification: Full API documentation with tagged tool categorization
# Clone the repository
git clone https://github.com/Unicorn-Commander/The_Colonel.git
cd The_Colonel
# Set up virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install in development mode
pip install -e .Traditional Terminal Interface:
interpreterOpen WebUI Server Mode:
interpreter --openwebui_server --host localhost --port 8264With Custom Profile:
interpreter --openwebui_server --profile The_Colonel.pyRemote Access with Authentication:
interpreter --openwebui_server --host 0.0.0.0 --port 8264 --auth_token your_secure_tokenQuick Start Scripts:
# Local development (no authentication)
./start_server.sh
# Remote access with authentication
./start_server_auth.shThe_Colonel provides 4 specialized tool servers that can be added individually to Open WebUI:
π Python Code Executor:
- Server:
http://your-ip:8264/python - OpenAPI:
http://your-ip:8264/python/openapi.json - Execute Python code, data analysis, calculations
π§ Shell Command Executor:
- Server:
http://your-ip:8264/shell - OpenAPI:
http://your-ip:8264/shell/openapi.json - Run bash/shell commands, system operations
π File Operations:
- Server:
http://your-ip:8264/files - OpenAPI:
http://your-ip:8264/files/openapi.json - Read, write, and manage files
π₯οΈ Computer Control:
- Server:
http://your-ip:8264/computer - OpenAPI:
http://your-ip:8264/computer/openapi.json - Screenshots, mouse clicks, keyboard input
GET /openapi.json- Complete API specificationPOST /v1/chat/completions- OpenAI-compatible chat endpoint
LLM Connection:
- Base URL:
http://localhost:8264/v1 - Model:
the-colonel
Individual Tool Setup: Add each tool separately to Open WebUI with:
- Tool Server URL:
http://your-ip:8264/{tool-name} - API Key:
your-auth-token - OpenAPI JSON:
http://your-ip:8264/{tool-name}/openapi.json
π Complete Tool Documentation: See Tool Reference Guide for detailed setup instructions, examples, and usage patterns.
Use the profile query parameter for chat completions:
curl -X POST "http://localhost:8264/v1/chat/completions?profile=The_Colonel" \
-H "Content-Type: application/json" \
-d '{"messages": [{"role": "user", "content": "Hello"}]}'For Developers:
- Code execution and debugging through web interface
- File management and project manipulation
- Automated testing and deployment scripts
For Power Users:
- Computer automation via API calls
- Screen capture and GUI automation
- Advanced file processing workflows
For Integration:
- Embed in existing web applications
- Build custom frontends with the API
- Create automated workflows and pipelines
Local Development:
- No authentication required for
localhostaccess - Safe for development and testing
Remote Access:
- Bearer token authentication required
- Use strong tokens for production deployments
Code Execution:
- All code execution happens in your local environment
- Review and approve code before execution in interactive mode
- Use
auto_runcarefully in production environments
from interpreter import interpreter
# Basic chat
interpreter.chat("Analyze this dataset and create visualizations")
# Streaming responses
for chunk in interpreter.chat("Process these files", stream=True):
print(chunk)
# Custom configuration
interpreter.llm.model = "gpt-4"
interpreter.auto_run = True
interpreter.os = True # Enable OS control featuresCreate custom profiles in interpreter/terminal_interface/profiles/defaults/:
# my_profile.py
from interpreter import interpreter
interpreter.llm.model = "gpt-4"
interpreter.llm.temperature = 0.1
interpreter.auto_run = True
interpreter.os = True
interpreter.computer.import_computer_api = TrueUse with:
interpreter --profile my_profile.pyThe_Colonel features advanced streaming response handling that properly processes various chunk formats from the interpreter:
- Error-Resilient: Individual chunk processing errors don't crash the entire conversation
- Format-Agnostic: Handles dictionary chunks, string chunks, and malformed data gracefully
- Type-Safe: Uses
.get()methods instead of direct key access to prevent KeyErrors - Debug-Friendly: Comprehensive logging for troubleshooting chunk processing issues
Streaming Response Flow:
- OpenAI-compatible request received
- Profile configuration loaded dynamically
- Messages converted to interpreter format
- Interpreter streams chunks in real-time
- Chunks processed through robust error handling
- Server-Sent Events formatted for Open WebUI
- Real-time display in web interface
1. API Key Authentication Errors
# Check your API key is set correctly
echo $OPENAI_API_KEY
# Update .env file if needed
nano .env2. Streaming Response Issues
- "Error: 'type'" on second messages β Fixed with improved message state management
- Messages appear in terminal but not GUI β Resolved with proper SSE formatting
- KeyError 'type' exceptions β Handled with robust chunk processing
3. Profile Loading Problems
# Clear Python cache if profiles aren't reloading
find . -name "*.pyc" -delete
find . -name "__pycache__" -type d -exec rm -rf {} +4. Port Already in Use
# Find and kill process using port 8264
lsof -ti:8264 | xargs kill -9Enable detailed logging:
interpreter --openwebui_server --verboseCopy .env.example to .env and configure your settings:
cp .env.example .env
# Edit with your actual API keys and settings# API Keys
OPENAI_API_KEY=your_openai_key_here
ANTHROPIC_API_KEY=your_anthropic_key_here
XAI_API_KEY=your_xai_key_here
DEEPSEEK_API_KEY=your_deepseek_key_here
# Server Configuration
DEFAULT_PROFILE=The_Colonel.py
SERVER_HOST=0.0.0.0
SERVER_PORT=8264
AUTH_TOKEN=your_secure_random_token
# General Settings
DISABLE_TELEMETRY=true
AUTO_RUN=false
SAFE_MODE=offAdvanced profile example with environment-based API key:
# custom_profile.py
import os
from interpreter import interpreter
# Model Configuration
interpreter.llm.model = "gpt-4o-mini"
interpreter.llm.api_key = os.getenv("OPENAI_API_KEY")
interpreter.llm.temperature = 0.1
interpreter.llm.context_window = 128000
interpreter.llm.max_tokens = 16384
# Capabilities
interpreter.auto_run = True
interpreter.os = True
interpreter.computer.import_computer_api = True
# Custom instructions for better computer control
interpreter.custom_instructions = """
When taking screenshots, if you encounter errors with pywinctl,
try using computer.display.screenshot(active_app_only=False) instead.
"""The_Colonel/
βββ interpreter/
β βββ core/
β β βββ openwebui_server.py # Open WebUI integration
β β βββ ...
β βββ computer_use/
β β βββ tools/ # Computer control tools
β βββ terminal_interface/
β βββ profiles/ # Configuration profiles
βββ openapi.json # API specification
βββ documentation/ # Project documentation
βββ examples/ # Usage examples
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes and test thoroughly
- Submit a pull request with detailed description
# Test server functionality
source venv/bin/activate
python -c "from interpreter.core.openwebui_server import create_openwebui_server; print('β
Server tests passed')"
# Start test server
interpreter --openwebui_server --host localhost --port 8264
# Test endpoints
curl http://localhost:8264/openapi.json- Tool Reference Guide - Complete tool documentation with examples
- Technical Implementation Guide - Architecture and technical details
- Project Summary - Project overview and current status
- Setup Guide - Installation and configuration
- OpenAPI Spec - Complete API documentation
The_Colonel builds upon the excellent foundation of Open Interpreter, adding:
- Open WebUI compatibility
- Enhanced tool endpoints
- Computer control capabilities
- Improved profile system
- Production-ready API server
This project is licensed under the AGPL License - see the LICENSE file for details.
- Open Interpreter Team - For the incredible foundation
- Open WebUI Community - For the inspiration and integration target
- Contributors - For making this project better
auto_run mode or in production environments.