FiddleBot is an interactive CLI chatbot powered by OpenAI's GPT-4.1-mini model, specifically designed to provide information and assistance about Fiddler - the pioneer in AI Observability and Security.
- Interactive command-line interface for chatting with the AI
- Powered by OpenAI's GPT-4.1-mini model
- Maintains conversation history for context-aware responses
- Focused on providing information about Fiddler's AI Observability and Security platform
- Asynchronous operation for better performance
- Python 3.12 or higher
- Fiddler Access Details
- OpenAI API key
- UV (recommended for package management and running)
- Clone the repository:
git clone <repository-url>
cd FiddleBot
- Create a
.env
file in the project root and add your OpenAI API key:
FIDDLER_BASE_URL=<your fiddler url>
FIDDLER_ACCESS_TOKEN=<your fiddler access token>
OPENAI_API_KEY=<your_api_key_here>
If you haven't installed UV yet, you can install it by following the instructions in the following link
# Create a new virtual environment and install dependencies
uv venv
source .venv/bin/activate # On Unix/macOS
# or
.venv\Scripts\activate # On Windows
# Install dependencies from pyproject.toml
uv pip install .
Run the chatbot using UV:
uv run src/fdl_chat.py src/fdl_mcp_server.py
- Type your message and press Enter to chat with the AI
- Type
q
,quit
, orexit
to end the conversation - Press Ctrl+C to exit at any time
Run the streamlit chatbot with
uv run streamlit run src/app.py
uv run opentelemetry-instrument --traces_exporter console --service_name fiddlebot_local python src/fdl_chat.py src/fdl_mcp_server.py
- Login to dev VPN
- Setup port forwarding to Fiddler's current OTEL Endpoint
fkube fdl-newdev -n leeannotel port-forward svc/otel-to-kafka-collector 4318:4318
- Run Fiddlebot as below
uv run src/fdl_chat.py src/fdl_mcp_server.py
Fiddler is the pioneer in AI Observability and Security, enabling organizations to build trustworthy and responsible AI systems. The platform helps:
- Monitor performance of ML models and generative AI applications
- Protect LLM and GenAI applications with Guardrails
- Analyze model behavior to identify issues and opportunities
- Improve AI systems through actionable insights
FiddleBot is built with a modular architecture that combines several key components:
-
Chat Interface (
fdl_chat.py
)- Implements an asynchronous chatbot using OpenAI's GPT-4.1-mini model
- Maintains conversation history for context-aware responses
- Handles user input/output through a CLI interface
- Integrates with the planning and execution system
-
Planning and Execution System (
fdl_plan_n_solve.py
)- Implements a multi-step planning and execution framework
- Uses GPT-4.1-mini for task decomposition and planning
- Manages tool execution through an MCP (Model Context Protocol) server
- Handles conversation state and tool call results
-
MCP Server (
fdl_mcp_server.py
)- Implements a FastMCP server for tool execution
- Provides a set of tools for interacting with the Fiddler platform
- Handles authentication and API communication with Fiddler
- Exposes tools for project, model, and alert management
-
Asynchronous Operation
- Uses Python's
asyncio
for non-blocking I/O operations - Enables concurrent handling of multiple operations
- Improves performance and responsiveness
- Uses Python's
-
Tool Integration
- Implements a flexible tool system through MCP
- Supports dynamic tool discovery and execution
- Enables extensibility through custom tool definitions
-
Conversation Management
- Maintains conversation history for context
- Handles system prompts and user interactions
- Manages tool call results and responses
-
Error Handling
- Implements robust error handling for API calls
- Manages connection issues and timeouts
- Provides graceful cleanup of resources
- User input is received through the chat interface
- The input is processed by the planning system
- The planning system generates a sequence of steps
- Each step is executed through the MCP server
- Results are collected and formatted into a response
- The response is returned to the user
- API keys and sensitive information are managed through environment variables
- Authentication is handled through Fiddler's token-based system
- All API communications are secured through HTTPS