chatlab
LLM chat app for integration tests using llama-stack-client, llama, Ollama, MCP, Tools
claude mcp add --transport stdio ricardoborges-chatlab python -m chatlab \ --env DEFAULT_STACK="Ollama (optional: set to Ollama to force local Ollama usage)" \ --env TOGETHER_API_KEY="Together API key (required if using Together.ai API)" \ --env TAVILY_SEARCH_API_KEY="your TanVily search API key (optional, required if using TAVILY features)"
How to use
Chatlab provides a Gradio-based UI that can operate with Ollama locally or via the Together.ai API to perform LLM inference. The setup allows you to run a local Ollama model (e.g., llama3.2:3b) or connect to Together to access larger models through an API key. The application workflow is managed via LLama-Stack for environment management, and Gradio serves as the frontend interface for interacting with the model. Once running, you can input prompts, customize model selection via environment variables, and choose between local Ollama inference or API-based inference depending on your configuration. The guidance in the repository focuses on ensuring the inference environment is properly prepared and that necessary API keys are supplied if you opt for Together-based inference. The interface will be accessible in your browser after starting the Gradio server with the provided command.
How to install
Prerequisites:
- A compatible OS with Python and shell access
- Ollama (optional for local inference)
- uv package manager
- Git
Installation steps:
-
Install Ollama (optional for local inference):
- Visit https://ollama.com/ and follow the installation instructions for your OS.
- Start the service: ollama serve
- Pull a model (example): ollama pull llama3.2:3b
-
Install LLama-Stack tooling (uv):
- Install the uv package manager according to its documentation.
- Create and activate a virtual environment (venv) as needed.
-
Project setup:
- Clone the repository: git clone https://github.com/ricardoborges/chatlab.git cd chatlab
- Create/activate a Python virtual environment and install dependencies: uv venv uv pip install -r myproject.toml
-
Run the application (Gradio):
- If you use Together.ai, obtain an API key from Together and place it in your environment or .env file as TOGETHER_API_KEY.
- Create a .env file with required keys, for example: TAVILY_SEARCH_API_KEY= TOGETHER_API_KEY=
- Start the Gradio interface: gradio main.py
- Open the URL provided by Gradio in your web browser.
Prerequisites recap:
- Git
- Python environment with uv available
- Ollama (optional for local inference) and model(s) if using Ollama
- Together API key if using Together.ai
Additional notes
Tips and notes:
- If you prefer local inference with Ollama, ensure the Ollama service is running and the model is pulled before starting the Gradio interface.
- If using Together.ai, you must provide a valid TOGETHER_API_KEY; otherwise, you can set DEFAULT_STACK to Ollama to run locally.
- TM values in the .env file are placeholders; replace them with your actual keys or leave them empty if not using those services.
- The chatlab workflow relies on LLama-Stack for environment management; ensure you have uv installed and accessible in your shell.
- Troubleshooting: verify that the Ollama service is up, the virtual environment is activated, and dependencies are installed correctly. If Gradio fails to start, check that the port is not in use and that Python can locate main.py.
Related MCP Servers
PPTAgent
An Agentic Framework for Reflective PowerPoint Generation
npcpy
The python library for research and development in NLP, multimodal LLMs, Agents, ML, Knowledge Graphs, and more.
AgentChat
AgentChat 是一个基于 LLM 的智能体交流平台,内置默认 Agent 并支持用户自定义 Agent。通过多轮对话和任务协作,Agent 可以理解并协助完成复杂任务。项目集成 LangChain、Function Call、MCP 协议、RAG、Memory、Milvus 和 ElasticSearch 等技术,实现高效的知识检索与工具调用,使用 FastAPI 构建高性能后端服务。
python -client
支持查询主流agent框架技术文档的MCP server(支持stdio和sse两种传输协议), 支持 langchain、llama-index、autogen、agno、openai-agents-sdk、mcp-doc、camel-ai 和 crew-ai
mcp-in-action
极客时间MCP新课已经上线!超2000同学一起开启MCP学习之旅!
LLaMa -Streamlit
AI assistant built with Streamlit, NVIDIA NIM (LLaMa 3.3:70B) / Ollama, and Model Control Protocol (MCP).