格里戈里·鲁姆
递归语言模型模式使用Claude.ai(订阅)作为根LLM,Ollama通过MCP处理子调用。
概述
问题: RLM需要编程LLM访问,但许多用户只有Claude.ai订阅(没有API密钥)。
解决方案: 使用Claude.ai作为“智能”根LLM(由订阅覆盖),并通过MCP将子LLM调用卸载到本地Ollama。
User (Claude.ai subscriber)
|
Claude.ai chat (root LLM)
|
Calls Grigori MCP tool
|
Grigori chunks context + calls Ollama (free, local)
|
Aggregated results return to Claude.ai
|
Claude synthesizes final answer先决条件
- .NET 10 SDK
- Ollama在当地跑步(
http://localhost:11434)
跑
# HTTP mode (default)
dotnet run --project src/Grigori.Rlm.Mcp
# stdio mode (for Claude Desktop)
dotnet run --project src/Grigori.Rlm.Mcp -- --mcp配置
编辑 src/Grigori.Rlm.Mcp/appsettings.json:
{
"Ollama": {
"BaseUrl": "http://localhost:11434",
"Model": "llama3.2",
"TimeoutSeconds": 120,
"MaxConcurrentRequests": 4
}
}项目结构
src/
├── Grigori.Infrastructure/
│ ├── LlmClients/ # ILlmClient, OllamaClient
│ └── Services/ # ChunkingService, DeepExplorationService
└── Grigori.Rlm.Mcp/
└── Features/Explore/ # MCP tool endpointsMCP工具
explore_codebase-使用局部LLM进行逐块分析的深度探索
许可证
麻省理工学院
