一键重装系统工具 | U盘启动盘制作工具 | 误删文件恢复软件 | 硬盘数据抢救专家 | 电脑蓝屏修复助手 | C盘空间清理神器 | 电脑驱动离线安装工具 | 微信聊天记录恢复工具 | 照片误格式化恢复 | 电脑密码破解清除工具 | 系统崩溃紧急救援盘 | 电脑加速优化大师 | 电脑开不了机怎么重装系统 | 回收站清空了怎么恢复 | 硬盘分区丢失数据恢复 | 电脑卡顿重装系统有用吗 | U盘插入提示格式化数据恢复 | 电脑中毒文件被隐藏恢复 | 忘记电脑开机密码怎么办 | 新硬盘分区对齐工具 | 旧电脑装Win10流畅工具 | SD卡照片删除恢复免费版 | 移动硬盘打不开提示损坏修复 | 电脑无故重启系统修复工具 | 电脑小白一键重装神器 | 程序员电脑环境配置助手 | 设计师电脑字体/素材恢复工具 | 网吧网管系统维护工具箱 | 财务人员电脑发票备份恢复 | 学生党免费电脑系统安装包 | 电脑维修师傅必备工具盘 | 游戏玩家电脑性能优化助手 | 办公白领误删文档恢复软件 | 自媒体视频素材恢复工具 | 网课录制视频损坏修复工具 | 最好的U盘PE系统排名 | 数据恢复软件哪个最强 | 免费电脑助手与收费版区别 | 国产装机工具哪款无广告 | 离线版驱动助手推荐 | 轻量级电脑优化工具对比 | 支持NVMe驱动的PE工具 | 带网络功能的应急启动盘 | 2026最新版万能装机工具 | 支持Win11 24H2的PE工具 | 最新免激活系统重装工具 | 2026数据恢复软件破解版合集 | 纯净无捆绑装机助手V3.0 | 支持苹果M芯片的电脑助手 | 秋季更新版系统维护工具箱 | 电脑系统崩了怎么用U盘把重要资料拷贝出来 | 重装系统前哪些文件夹必须备份 | 固态硬盘误格式化还能恢复数据吗 | 如何制作一个既带PE又能存数据的双分区U盘 | 电脑总是弹窗广告用什么助手彻底拦截 后台管理
📢 欢迎访问系统之家!所有资源均经过安全检测。

Using your own LLM models in GitHub Copilot CLI

发布时间:2026-08-28 | 浏览:1
📥 下载地址(文章开头)
装机神器,专门安装各种电脑系统,各种品牌全可以。
Use a model from an external provider of your choice in Copilot by supplying your own API key. In this article You can configure Copilot CLI to use your own LLM provider, also called BYOK (Bring Your Own Key), instead of GitHub-hosted models. This lets you connect to OpenAI-compatible endpoints, Azure OpenAI, or Anthropic, including locally running models such as Ollama. This article is for users who want to configure their own LLM provider API key on their local machine. To set up custom models for users in an enterprise, see Enabling custom models for GitHub Copilot in your enterprise . Copilot CLI is installed. See Installing GitHub Copilot CLI . You have an API key from a supported LLM provider, or you have a local model running (such as Ollama). Supported providers Copilot CLI supports three provider types: For additional examples, run copilot help providers in your terminal. Model requirements Models must support tool calling (also called function calling) and streaming . If a model does not support either capability, Copilot CLI returns an error. For best results, use a model with a context window of at least 128k tokens. Configuring your provider You configure your model provider by setting environment variables before starting Copilot CLI. Connecting to an OpenAI-compatible endpoint Use the following steps if you are connecting to OpenAI, Ollama, vLLM, Foundry Local, or any other endpoint that is compatible with the OpenAI Chat Completions API. Set environment variables for your provider. For example, for a local Ollama instance: export COPILOT_PROVIDER_BASE_URL=http://localhost:11434 export COPILOT_MODEL=YOUR-MODEL-NAME Replace YOUR-MODEL-NAME with the name of the model you have pulled in Ollama (for example, llama3.2 ). Set environment variables for your provider. For example, for a local Ollama instance: Replace YOUR-MODEL-NAME with the name of the model you have pulled in Ollama (for example, llama3.2 ). For a remote OpenAI endpoint, also set your API key. export COPILOT_PROVIDER_BASE_URL=https://api.openai.com/v1 export COPILOT_PROVIDER_API_KEY=YOUR-OPENAI-API-KEY export COPILOT_MODEL=YOUR-MODEL-NAME Replace YOUR-OPENAI-API-KEY with your OpenAI API key and YOUR-MODEL-NAME with the model you want to use (for example, gpt-4o ). For a remote OpenAI endpoint, also set your API key. Replace YOUR-OPENAI-API-KEY with your OpenAI API key and YOUR-MODEL-NAME with the model you want to use (for example, gpt-4o ). Start Copilot CLI. Start Copilot CLI. Connecting to Azure OpenAI
📥 下载地址(文章中间)
装机神器,专门安装各种电脑系统,各种品牌全可以。
Set the environment variables for Azure OpenAI. export COPILOT_PROVIDER_BASE_URL=https://YOUR-RESOURCE-NAME.openai.azure.com/openai/deployments/YOUR-DEPLOYMENT-NAME export COPILOT_PROVIDER_TYPE=azure export COPILOT_PROVIDER_API_KEY=YOUR-AZURE-API-KEY export COPILOT_MODEL=YOUR-DEPLOYMENT-NAME Replace the following placeholders: YOUR-RESOURCE-NAME : your Azure OpenAI resource name YOUR-DEPLOYMENT-NAME : the name of your model deployment YOUR-AZURE-API-KEY : your Azure OpenAI API key Set the environment variables for Azure OpenAI. Replace the following placeholders: YOUR-RESOURCE-NAME : your Azure OpenAI resource name YOUR-DEPLOYMENT-NAME : the name of your model deployment YOUR-AZURE-API-KEY : your Azure OpenAI API key Start Copilot CLI. Start Copilot CLI. Connecting to Anthropic Set the environment variables for Anthropic: export COPILOT_PROVIDER_TYPE=anthropic export COPILOT_PROVIDER_BASE_URL=https://api.anthropic.com export COPILOT_PROVIDER_API_KEY=YOUR-ANTHROPIC-API-KEY export COPILOT_MODEL=YOUR-MODEL-NAME Replace YOUR-ANTHROPIC-API-KEY with your Anthropic API key and YOUR-MODEL-NAME with the Claude model you want to use (for example, claude-opus-4-5 ). Set the environment variables for Anthropic: Replace YOUR-ANTHROPIC-API-KEY with your Anthropic API key and YOUR-MODEL-NAME with the Claude model you want to use (for example, claude-opus-4-5 ). Start Copilot CLI. Start Copilot CLI. Running in offline mode You can run Copilot CLI in offline mode to prevent it from contacting GitHub's servers. This is designed for isolated environments where the CLI should communicate only with your local or on-premises model provider. Offline mode only guarantees full network isolation if your provider is also local or within the same isolated environment. If COPILOT_PROVIDER_BASE_URL points to a remote endpoint, your prompts and code context are still sent over the network to that provider. Configure your provider environment variables as described in Configuring your provider. Configure your provider environment variables as described in Configuring your provider. Set the offline mode environment variable: export COPILOT_OFFLINE=true Set the offline mode environment variable: Start Copilot CLI. Start Copilot CLI.
📥 下载地址(文章结尾)
装机神器,专门安装各种电脑系统,各种品牌全可以。