使用说明
⚡ 艾拉瓦特-Daemon
Airavat MCP代理。处理LLM通信、MCP服务器管理和配置。
设置
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
跑步
# Development (with hot reload)
uvicorn src.server:app --reload --port 8920
# Production
uvicorn src.server:app --host 0.0.0.0 --port 8920
API服务器运行于 http://localhost:8920.
配置
代理配置.json
LLM提供程序和代理设置:
{
"llm": {
"provider": "ollama",
"anthropic": { "model": "...", "apiKey": "..." },
"gemini": { "model": "...", "apiKey": "..." },
"ollama": { "baseUrl": "http://localhost:11434", "model": "llama3.2:3b" }
},
"agent": {
"systemPrompt": "...",
"maxToolRoundtrips": 10
}
}
mcp-config.json
MCP服务器连接:
{
"mcpServers": {
"browser": { "enabled": true, "command": "npx", "args": [...] },
"filesystem": { "enabled": true, "command": "npx", "args": [...] }
}
}
ui-config.json
主题和其他UI首选项。此文件现在存储在守护程序根目录中
服务于 /api/settings/ui 端点,以便web UI可以读取/写入
它就像其他配置一样:
{
"theme": "dark" # or "light"
}
API终点
| 方法 | 端点 | 描述 |
|---|---|---|
| 职位 | /api/chat |
发送聊天消息 |
| 职位 | /api/clear |
清除聊天记录 |
| 得到 | /api/servers |
获取LLM和MCP服务器状态 |
| 得到 | /api/settings/agent |
获取代理配置 |
| 补丁 | /api/settings/agent/llm |
切换LLM提供程序/型号 |
| 得到 | /api/settings/mcp |
获取MCP服务器列表 |
| 补丁 | /api/settings/mcp/:name |
切换MCP服务器 |
| 得到 | /api/settings/ui |
获取UI配置 |
| 职位 | /api/settings/ui |
保存UI配置 |
| 得到 | /api/ollama/models |
列出Olama车型 |
| 得到 | /api/models/anthropic |
列出人体模型 |
| 得到 | /api/models/gemini |
列出Gemini型号 |
| 获取/发布 | /api/settings/agent/apikey |
管理API密钥 |
码头工人
# Build (run from project root)
docker build -f airavat-daemon/Dockerfile .
# Run
docker run -p 8920:8920 airavat-daemon:latest
项目结构
airavat-daemon/
├── src/
│ ├── server.py # FastAPI server & API routes
│ ├── agent.py # LLM agent logic
│ ├── config.py # Config file handling
│ └── mcp_manager.py # MCP server management
├── agent-config.json
├── mcp-config.json
├── ui-config.json
├── pyproject.toml
└── Dockerfile