AMD TokenFactory Provider for Copilot
English | 中文
English
A VS Code extension that integrates the AMD TokenFactory (Radeon AI Developer, free endpoint) models into GitHub Copilot Chat.
Architecture based on tokenrhythm-copilot (AGPL-3.0), which itself is based on opencode-go-copilot (MIT) and oai-compatible-copilot (MIT).
Features
Two features only — nothing else:
- OpenAI-compatible endpoint (
https://developer.amd.com.cn/radeon/api/v1)
- Standard Chat Completions protocol with SSE streaming
- Reasoning/thinking content (
reasoning_content) shown in Copilot's thinking UI
- Vision input (image_url) for vision-capable models
- Tool calling passthrough
- Automatic model discovery from the
/models endpoint (with a built-in fallback list)
- Token usage reported to Copilot's native token indicator
- Multi-key rotation
- Configure any number of
rc-... API keys; every request picks the next available key (rotation) or sticks to one key until it fails (sticky)
- Keys failing with rotation errors (401 / 429 / 5xx, configurable status codes and text patterns) are skipped and the request retries with the next key
- Transient failures (429 / 5xx) cool the key down for a configurable period instead of disabling it permanently, plus a whole-round exponential-backoff retry
- Key management UI: add / batch import / delete / reset / availability check (masked display)
Get an API Key
Sign in at https://developer.amd.com.cn/radeon/tokenfactory and create an API key (format rc-...).
Usage
- Install the extension and run the command
AMD TokenFactory: Manage API Keys (multi-key rotation) (or click the provider in the Copilot Chat model picker — it opens the key manager).
- Add at least one key.
- Open the Copilot Chat model picker and choose a model under the AMD TokenFactory vendor.
Extension Settings
| Setting |
Default |
Description |
amdTokenFactory.baseUrl |
https://developer.amd.com.cn/radeon/api/v1 |
API base URL |
amdTokenFactory.apiKeyMode |
rotation |
rotation (next key per request) or sticky (keep current key until it fails) |
amdTokenFactory.apiKeyRotationStatusCodes |
[401,429,500,502,503,504] |
HTTP status codes that trigger switching to the next key |
amdTokenFactory.apiKeyRotationErrorPatterns |
rate limit / concurrency / invalid bearer token … |
Error text patterns that trigger switching to the next key |
amdTokenFactory.transientRetryStatusCodes |
[429,500,502,503,504] |
Status codes treated as transient (cooldown + whole-round retry) |
amdTokenFactory.exhaustedCooldownMin |
5 |
Cooldown minutes for transiently failed keys |
amdTokenFactory.transientRetryTimes |
3 |
Whole-round automatic retries when all keys are cooling down |
amdTokenFactory.requestTimeout |
300000 |
Request timeout (ms) |
amdTokenFactory.enableAutoModelDiscovery |
true |
Discover the model list from /models |
amdTokenFactory.maxInputTokensRatio |
1.0 |
Declared input window ratio (controls Copilot auto-compaction) |
amdTokenFactory.temperature / amdTokenFactory.top_p |
null |
Sampling params (null = not sent) |
amdTokenFactory.retry.* |
enabled / 3 / 1000 |
Per-request retry (network + retryable status codes) |
Build
npm install
npm run compile
npm run build # package as amd-tokenfactory-copilot-<version>.vsix
License
MIT. Architecture based on tokenrhythm-copilot (AGPL-3.0), based on opencode-go-copilot (MIT) and oai-compatible-copilot (MIT).
中文
把 AMD TokenFactory(Radeon AI 开发者平台,免费端点)的模型接入 GitHub Copilot Chat 的 VS Code 扩展。
功能
只有两个功能,没有别的:
- OpenAI 兼容端点(
https://developer.amd.com.cn/radeon/api/v1)
- 标准 Chat Completions 协议 + SSE 流式输出
- 思考内容(
reasoning_content)显示在 Copilot 的思考 UI 里
- 视觉模型支持图片输入(image_url)
- 工具调用透传
- 自动从
/models 端点发现模型列表(带内置兜底清单)
- token 用量上报到 Copilot 原生 token 指示器
- 多 Key 轮询
- 配置任意数量的
rc-... API Key;每次请求取下一个可用 Key(轮询模式),或固定用一个 Key 直到失效再切换(固定模式)
- Key 遇到轮换错误(401 / 429 / 5xx,状态码与文本 patterns 可配置)时跳过该 Key 换下一个重试
- 瞬态故障(429 / 5xx)只做冷却不永久禁用,外加整轮指数退避自动重试
- Key 管理界面:添加 / 批量导入 / 删除 / 重置失效 / 可用性检测(全部脱敏显示)
获取 API Key
在 https://developer.amd.com.cn/radeon/tokenfactory 登录并创建 API Key(格式 rc-...)。
使用
- 安装扩展,运行命令
AMD TokenFactory: 管理 API Keys(多 Key 轮询)(或在 Copilot Chat 模型选择器里点本提供商,会直接打开 Key 管理界面)。
- 添加至少一个 Key。
- 打开 Copilot Chat 的模型选择器,选择 AMD TokenFactory 下的模型。
编译
npm install
npm run compile
npm run build # 打包为 amd-tokenfactory-copilot-<version>.vsix
许可
MIT。架构基于 tokenrhythm-copilot(AGPL-3.0),其基于 opencode-go-copilot(MIT)与 oai-compatible-copilot(MIT)。