mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 13:38:31 +00:00
refactor(registry): B2 migrate to LiteLLM-style schema — unified models[] with kind field
- 71 registry files: flat `media.*Config.models` → `models[]` with `kind` field - `media` wrapper removed → serviceKinds, *Config fields promoted top-level - `type` field renamed to `kind` (llm/image/tts/stt/embedding/embedding/video/music) - providers/index.js: PROVIDER_MEDIA now built from flat top-level media fields - shared/constants/providers.js: buildProviderEntry reads flat top-level media fields - route /v1/models: modelKind() uses kind||type; removed subConfig merge block - models/info route: removed sub-config fallback lookup (all models in PROVIDER_MODELS) - ttsProviders/index.js: synthesizeViaConfig reads tts models from PROVIDER_MODELS - test-models route, helpers.js, validate route: kind||type compat - Baselines: PROVIDERS 62/62 ✅, Alias 90/90 ✅ Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,24 +1,23 @@
|
||||
|
||||
export default {
|
||||
"id": "github",
|
||||
"alias": "gh",
|
||||
id: "github",
|
||||
alias: "gh",
|
||||
uiAlias: "gh",
|
||||
display: {
|
||||
"name": "GitHub Copilot",
|
||||
"icon": "code",
|
||||
"color": "#333333",
|
||||
"website": "https://github.com/features/copilot",
|
||||
"notice": {
|
||||
"signupUrl": "https://github.com/features/copilot"
|
||||
},
|
||||
"deprecated": true,
|
||||
"deprecationNotice": "RISK_NOTICE"
|
||||
name: "GitHub Copilot",
|
||||
icon: "code",
|
||||
color: "#333333",
|
||||
website: "https://github.com/features/copilot",
|
||||
notice: {
|
||||
signupUrl: "https://github.com/features/copilot",
|
||||
},
|
||||
deprecated: true,
|
||||
deprecationNotice: "RISK_NOTICE",
|
||||
},
|
||||
category: "oauth",
|
||||
uiAlias: "gh",
|
||||
"transport": {
|
||||
"baseUrl": "https://api.githubcopilot.com/chat/completions",
|
||||
"responsesUrl": "https://api.githubcopilot.com/responses",
|
||||
"headers": {
|
||||
transport: {
|
||||
baseUrl: "https://api.githubcopilot.com/chat/completions",
|
||||
responsesUrl: "https://api.githubcopilot.com/responses",
|
||||
headers: {
|
||||
"copilot-integration-id": "vscode-chat",
|
||||
"editor-version": "vscode/1.110.0",
|
||||
"editor-plugin-version": "copilot-chat/0.38.0",
|
||||
@@ -27,136 +26,63 @@ export default {
|
||||
"x-github-api-version": "2025-04-01",
|
||||
"x-vscode-user-agent-library-version": "electron-fetch",
|
||||
"X-Initiator": "user",
|
||||
"Accept": "application/json",
|
||||
"Content-Type": "application/json"
|
||||
Accept: "application/json",
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
copilot: {
|
||||
vscodeVersion: "1.110.0",
|
||||
chatVersion: "0.38.0",
|
||||
userAgent: "GitHubCopilotChat/0.38.0",
|
||||
apiVersion: "2025-04-01",
|
||||
},
|
||||
usage: {
|
||||
url: "https://api.github.com/copilot_internal/user",
|
||||
},
|
||||
copilot: { vscodeVersion: "1.110.0", chatVersion: "0.38.0", userAgent: "GitHubCopilotChat/0.38.0", apiVersion: "2025-04-01" },
|
||||
usage: { url: "https://api.github.com/copilot_internal/user" }
|
||||
},
|
||||
"oauth": {
|
||||
"clientId": "Iv1.b507a08c87ecfe98",
|
||||
"authorizeUrl": "https://github.com/login/oauth/authorize",
|
||||
"deviceCodeUrl": "https://github.com/login/device/code",
|
||||
"tokenUrl": "https://github.com/login/oauth/access_token",
|
||||
"userInfoUrl": "https://api.github.com/user",
|
||||
"scopes": "read:user",
|
||||
"apiVersion": "2022-11-28",
|
||||
"copilotTokenUrl": "https://api.github.com/copilot_internal/v2/token",
|
||||
"userAgent": "GitHubCopilotChat/0.26.7",
|
||||
"editorVersion": "vscode/1.85.0",
|
||||
"editorPluginVersion": "copilot-chat/0.26.7"
|
||||
},
|
||||
media: {
|
||||
serviceKinds: ["llm", "embedding"],
|
||||
embeddingConfig: { baseUrl: "https://models.github.ai/inference/embeddings", authType: "apikey", authHeader: "bearer", models: [{ id: "text-embedding-3-small", name: "Text Embedding 3 Small (GitHub)", dimensions: 1536 }, { id: "text-embedding-3-large", name: "Text Embedding 3 Large (GitHub)", dimensions: 3072 }] }
|
||||
},
|
||||
"models": [
|
||||
{
|
||||
"id": "gpt-3.5-turbo",
|
||||
"name": "GPT-3.5 Turbo"
|
||||
},
|
||||
{
|
||||
"id": "gpt-4",
|
||||
"name": "GPT-4"
|
||||
},
|
||||
{
|
||||
"id": "gpt-4o",
|
||||
"name": "GPT-4o"
|
||||
},
|
||||
{
|
||||
"id": "gpt-4o-mini",
|
||||
"name": "GPT-4o mini"
|
||||
},
|
||||
{
|
||||
"id": "gpt-4.1",
|
||||
"name": "GPT-4.1"
|
||||
},
|
||||
{
|
||||
"id": "gpt-5-mini",
|
||||
"name": "GPT-5 Mini"
|
||||
},
|
||||
{
|
||||
"id": "gpt-5.2",
|
||||
"name": "GPT-5.2"
|
||||
},
|
||||
{
|
||||
"id": "gpt-5.2-codex",
|
||||
"name": "GPT-5.2 Codex"
|
||||
},
|
||||
{
|
||||
"id": "gpt-5.3-codex",
|
||||
"name": "GPT-5.3 Codex"
|
||||
},
|
||||
{
|
||||
"id": "gpt-5.4",
|
||||
"name": "GPT-5.4"
|
||||
},
|
||||
{
|
||||
"id": "gpt-5.4-mini",
|
||||
"name": "GPT-5.4 Mini"
|
||||
},
|
||||
{
|
||||
"id": "claude-haiku-4.5",
|
||||
"name": "Claude Haiku 4.5"
|
||||
},
|
||||
{
|
||||
"id": "claude-opus-4.5",
|
||||
"name": "Claude Opus 4.5"
|
||||
},
|
||||
{
|
||||
"id": "claude-sonnet-4",
|
||||
"name": "Claude Sonnet 4"
|
||||
},
|
||||
{
|
||||
"id": "claude-sonnet-4.5",
|
||||
"name": "Claude Sonnet 4.5"
|
||||
},
|
||||
{
|
||||
"id": "claude-sonnet-4.6",
|
||||
"name": "Claude Sonnet 4.6"
|
||||
},
|
||||
{
|
||||
"id": "claude-opus-4.6",
|
||||
"name": "Claude Opus 4.6"
|
||||
},
|
||||
{
|
||||
"id": "claude-opus-4.7",
|
||||
"name": "Claude Opus 4.7"
|
||||
},
|
||||
{
|
||||
"id": "gemini-2.5-pro",
|
||||
"name": "Gemini 2.5 Pro"
|
||||
},
|
||||
{
|
||||
"id": "gemini-3-flash-preview",
|
||||
"name": "Gemini 3 Flash"
|
||||
},
|
||||
{
|
||||
"id": "gemini-3.1-pro-preview",
|
||||
"name": "Gemini 3.1 Pro"
|
||||
},
|
||||
{
|
||||
"id": "grok-code-fast-1",
|
||||
"name": "Grok Code Fast 1"
|
||||
},
|
||||
{
|
||||
"id": "oswe-vscode-prime",
|
||||
"name": "Raptor Mini"
|
||||
},
|
||||
{
|
||||
"id": "goldeneye-free-auto",
|
||||
"name": "GoldenEye"
|
||||
},
|
||||
{
|
||||
"id": "text-embedding-3-small",
|
||||
"name": "Text Embedding 3 Small (GitHub)",
|
||||
"type": "embedding"
|
||||
},
|
||||
{
|
||||
"id": "text-embedding-3-large",
|
||||
"name": "Text Embedding 3 Large (GitHub)",
|
||||
"type": "embedding"
|
||||
}
|
||||
models: [
|
||||
{ id: "gpt-3.5-turbo", name: "GPT-3.5 Turbo" },
|
||||
{ id: "gpt-4", name: "GPT-4" },
|
||||
{ id: "gpt-4o", name: "GPT-4o" },
|
||||
{ id: "gpt-4o-mini", name: "GPT-4o mini" },
|
||||
{ id: "gpt-4.1", name: "GPT-4.1" },
|
||||
{ id: "gpt-5-mini", name: "GPT-5 Mini" },
|
||||
{ id: "gpt-5.2", name: "GPT-5.2" },
|
||||
{ id: "gpt-5.2-codex", name: "GPT-5.2 Codex" },
|
||||
{ id: "gpt-5.3-codex", name: "GPT-5.3 Codex" },
|
||||
{ id: "gpt-5.4", name: "GPT-5.4" },
|
||||
{ id: "gpt-5.4-mini", name: "GPT-5.4 Mini" },
|
||||
{ id: "claude-haiku-4.5", name: "Claude Haiku 4.5" },
|
||||
{ id: "claude-opus-4.5", name: "Claude Opus 4.5" },
|
||||
{ id: "claude-sonnet-4", name: "Claude Sonnet 4" },
|
||||
{ id: "claude-sonnet-4.5", name: "Claude Sonnet 4.5" },
|
||||
{ id: "claude-sonnet-4.6", name: "Claude Sonnet 4.6" },
|
||||
{ id: "claude-opus-4.6", name: "Claude Opus 4.6" },
|
||||
{ id: "claude-opus-4.7", name: "Claude Opus 4.7" },
|
||||
{ id: "gemini-2.5-pro", name: "Gemini 2.5 Pro" },
|
||||
{ id: "gemini-3-flash-preview", name: "Gemini 3 Flash" },
|
||||
{ id: "gemini-3.1-pro-preview", name: "Gemini 3.1 Pro" },
|
||||
{ id: "grok-code-fast-1", name: "Grok Code Fast 1" },
|
||||
{ id: "oswe-vscode-prime", name: "Raptor Mini" },
|
||||
{ id: "goldeneye-free-auto", name: "GoldenEye" },
|
||||
{ id: "text-embedding-3-small", name: "Text Embedding 3 Small (GitHub)", kind: "embedding" },
|
||||
{ id: "text-embedding-3-large", name: "Text Embedding 3 Large (GitHub)", kind: "embedding" },
|
||||
],
|
||||
features: {"usage":true},
|
||||
serviceKinds: ["llm","embedding"],
|
||||
embeddingConfig: { baseUrl: "https://models.github.ai/inference/embeddings", authType: "apikey", authHeader: "bearer" },
|
||||
oauth: {
|
||||
clientId: "Iv1.b507a08c87ecfe98",
|
||||
authorizeUrl: "https://github.com/login/oauth/authorize",
|
||||
deviceCodeUrl: "https://github.com/login/device/code",
|
||||
tokenUrl: "https://github.com/login/oauth/access_token",
|
||||
userInfoUrl: "https://api.github.com/user",
|
||||
scopes: "read:user",
|
||||
apiVersion: "2022-11-28",
|
||||
copilotTokenUrl: "https://api.github.com/copilot_internal/v2/token",
|
||||
userAgent: "GitHubCopilotChat/0.26.7",
|
||||
editorVersion: "vscode/1.85.0",
|
||||
editorPluginVersion: "copilot-chat/0.26.7",
|
||||
},
|
||||
features: {
|
||||
usage: true,
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user