官方更新 GitHub Changelog Wed, 07 Oct 2026 正文 ok 248 words

在 GitHub Copilot CLI 中发现本地模型

英文标题:Discover local models in GitHub Copilot CLI

GitHub Copilot CLI 从 1.0.94-0 版本起支持通过 `/model` 发现正在运行的本地 Ollama 实例所支持的模型,并与已配置模型及 GitHub Copilot 云端模型一同展示。发现模型后,开发者可查看提供商和端点,并选择仅添加或添加后立即在当前会话中切换使用,无需重启 CLI。该功能不会自动安装 Ollama、运行时或模型,候选模型还必须支持工具调用和流式输出。GitHub 同时宣布将推出面向本地模型的智能路由,但使用本地模型并不意味着启用离线模式或关闭遥测数据收集。
打开原文相关 2 · 机会 4
media16.2 KB media25.6 KB

中文

GitHub Copilot CLI 让你能够在不离开现有工作流的情况下,更轻松地选择本地模型。从 CLI 1.0.94-0 版本开始,可使用 /model 发现正在运行的本地 Ollama 实例支持的模型;这些模型会与已配置的模型以及 GitHub Copilot 提供的云端模型一同显示。

发现功能不会自动添加模型。选择一个已发现的模型后,查看其提供商和端点,然后确认选择 添加并在本次会话中使用,或 添加但不切换。你可以无需重启 CLI,直接在当前会话中使用该模型。Ollama 和相应模型必须已经安装;这一流程不会安装运行时,也不会下载模型。模型必须支持工具调用和流式输出。

提供商连接失败时,模型选择器会显示相应说明,帮助你识别需要处理的问题。

这次 CLI 更新延续了 GitHub Copilot 应用中模型提供商体验的同一理念:选择适合你工作的模型。在应用中,可通过 设置 > 模型提供商 添加受支持的提供商。

选择本地模型并不会启用离线模式,也不会关闭 GitHub 遥测。在 CLI 中,离线模式仍需通过 COPILOT_OFFLINE=true 显式启用。即使处于离线模式,远程提供商仍可能通过网络接收提示词和代码上下文。有关配置与限制,请参阅 CLI 提供商和离线模式文档。

我们还宣布了面向本地模型的智能路由。请阅读 Microsoft Command Line 博客中的公告,并关注后续可用性信息。

进一步了解如何在 GitHub Copilot 应用中设置自己的模型提供商。

English / 原文

GitHub Copilot CLI makes it easier to choose a local model without leaving your existing workflow. Starting in CLI version 1.0.94-0, use /model to discover supported models from a running local Ollama instance, alongside your configured models and cloud models provided by GitHub Copilot.

Discovery doesn’t automatically add models. Choose a discovered model, review its provider and endpoint, then confirm Add and use for this session or Add without switching. You can use the model in your current session without restarting the CLI. Ollama and the model must already be installed—this flow doesn’t install a runtime or download models. Models must support tool calling and streaming.

Provider connection failures appear in the picker with an explanation, helping you identify what needs attention.

This CLI update builds on the same idea as the GitHub Copilot app’s provider experience: choose the model that fits your work. In the app, add a supported provider in Settings > Model providers.

Choosing a local model doesn’t turn on offline mode or disable GitHub telemetry. In the CLI, offline mode remains an explicit choice through COPILOT_OFFLINE=true. A remote provider can still receive prompts and code context over the network, even in offline mode. Follow the CLI provider and offline-mode documentation for configuration and limits.

We’re also announcing intelligent routing with local models. Read the announcement on the Microsoft Command Line blog and stay tuned for availability.

Learn more about setting up your own model provider in the GitHub Copilot app.