Status: [UNTESTED] Endpoints found: http://127.0.0.1:11434/api/tags http://127.0.0.1:11434/v1/models Source: https://github.com/BrillianceRen/ollama-bridge # ollama-bridge
**简体中文** · [English](README.en.md)
把 **OpenAI 兼容 API**(DeepSeek / 智谱 BigModel / Kimi / NVIDIA 等)、**Google Gemini Interactions API**、**Google Cloud Vertex AI Agent Platform API** 以及 **Google Antigravity 服务** 转换并暴露为 **Ollama 与 OpenAI 兼容 API**,供 **Visual Studio 2022 / 2026 内置的 GitHub Copilot** 通过「添加 Ollama Provider」使用自定义 AI 模型。**本项目非 VS Code 插件**。 全套工具仅依赖 Python 标准库,**零第三方运行时依赖**。 **若 Ollama 无效,可尝试 Foundry [foundry-proxy](https://github.com/BrillianceRen/foundry-proxy)。** --- ## 代理矩阵 | 代理脚本 | 对应平台 / API | 典型支持模型 | 默认端口 | | :--- | :--- | :--- | :--- | | **`openai_ollama_proxy.py`** | OpenAI 兼容接口(DeepSeek, 智谱, Kimi, NVIDIA, OpenCode 等) | `deepseek-v4-flash`, `glm-5.2`, `kimi`, `nvidia/*` 等 | `11434` | | **`gemini-ollama-proxy.py`** | Google AI Developer API (`v1beta/interactions`, `v1beta/models`) | `gemini-3.5-flash`, `gemini-3.7-flash`, `gemma-4-26b-a4b-it` 等 | `11434` | | **`vertex-ollama-proxy.py`** | Google Cloud Vertex AI Agent Platform (`generateContent`) | `gemini-2.5-flash`, `gemini-2.5-pro`, `gemini-2.5-flash-lite` 等 | `11434` | | **`antigravity-ollama-proxy.py`** | Google Antigravity 服务 (`daily-cloudcode-pa.googleapis.com`) | `claude-sonnet-4-6`, `claude-opus-4-6`, `gemini-3.8-flash-high`, `gemini-3.7-flash-high` 等 | `11434` | --- ## 安装与快速开始 ### 1. 准备环境 - Python 3.8+(运行时无需安装第三方包) - 复制配置文件模板并填入你的 API Key 或凭据: ```bash cp config.example.json config.json ``` ### 2. 启动服务 直接通过 Python 启动对应代理: #### (1) 通用 OpenAI 兼容代理 ```powershell python openai_ollama_proxy.py --config config.json ``` #### (2) Google Gemini Interactions 代理 ```powershell python