Show HN: Polymcp 和 Ollama 实现简单本地和云端 LLM 运行

1作者: justvugg2 天前
我们为 Polymcp 增加了对 Ollama 的一流支持,让运行大型语言模型变得简单——无论您是在本地工作还是在云端部署。 通过使用 Ollama 作为后端提供商,Polymcp 可以以最少的配置协调 MCP 服务器和模型。这让您可以专注于构建代理,而不是搭建基础设施。 ```python from polymcp.polyagent import PolyAgent, OllamaProvider agent = PolyAgent( llm_provider=OllamaProvider(model="gpt-oss:120b"), mcp_servers=["http://localhost:8000/mcp"] ) result = agent.run("法国的首都是什么?") print(result) ``` 这带来的好处: * 干净的编排:Polymcp 管理 MCP 服务器,而 Ollama 处理模型执行。 * 相同的流程,随处可用:在您的笔记本电脑或云端运行相同的设置。 * 灵活的模型选择:适用于 gpt-oss:120b、Kimi K2、Nemotron 以及 Ollama 支持的其他模型。 我们的目标是提供一种简单直接的方式来试验和部署由 LLM 驱动的代理,而无需额外的胶水代码。 欢迎提供关于您将如何使用此功能的反馈或想法。 仓库:[https://github.com/poly-mcp/Polymcp](https://github.com/poly-mcp/Polymcp)
查看原文
We’ve added first-class Ollama support to Polymcp to make running large language models easy—whether you’re working locally or deploying in the cloud.<p>By using Ollama as a backend provider, Polymcp can coordinate MCP servers and models with minimal configuration. This lets you focus on building agents instead of wiring infrastructure.<p>from polymcp.polyagent import PolyAgent, OllamaProvider<p>agent = PolyAgent( llm_provider=OllamaProvider(model=&quot;gpt-oss:120b&quot;), mcp_servers=[&quot;http:&#x2F;&#x2F;localhost:8000&#x2F;mcp&quot;] )<p>result = agent.run(&quot;What is the capital of France?&quot;) print(result)<p>What this enables: • Clean orchestration: Polymcp manages MCP servers while Ollama handles model execution. • Same workflow, everywhere: Run the same setup on your laptop or in the cloud. • Flexible model choice: Works with models like gpt-oss:120b, Kimi K2, Nemotron, and others supported by Ollama.<p>The goal is to provide a straightforward way to experiment with and deploy LLM-powered agents without extra glue code.<p>Would love feedback or ideas on how you’d use this.<p>Repo: <a href="https:&#x2F;&#x2F;github.com&#x2F;poly-mcp&#x2F;Polymcp" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;poly-mcp&#x2F;Polymcp</a>