From 56b10ddf1755b0ae457f424e9f43ae94c64a8323 Mon Sep 17 00:00:00 2001 From: Shakker Date: Fri, 1 May 2026 13:49:45 +0100 Subject: [PATCH] refactor: derive venice fallback catalog from manifest --- extensions/venice/models.ts | 388 +----------------------------------- 1 file changed, 11 insertions(+), 377 deletions(-) diff --git a/extensions/venice/models.ts b/extensions/venice/models.ts index eeb749aea0a..0ad91582d4e 100644 --- a/extensions/venice/models.ts +++ b/extensions/venice/models.ts @@ -1,11 +1,18 @@ +import { buildManifestModelProviderConfig } from "openclaw/plugin-sdk/provider-catalog-shared"; import type { ModelDefinitionConfig } from "openclaw/plugin-sdk/provider-model-shared"; import { createSubsystemLogger, retryAsync } from "openclaw/plugin-sdk/runtime-env"; import { fetchWithSsrFGuard } from "openclaw/plugin-sdk/ssrf-runtime"; import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/text-runtime"; +import manifest from "./openclaw.plugin.json" with { type: "json" }; const log = createSubsystemLogger("venice-models"); -export const VENICE_BASE_URL = "https://api.venice.ai/api/v1"; +const VENICE_MANIFEST_PROVIDER = buildManifestModelProviderConfig({ + providerId: "venice", + catalog: manifest.modelCatalog.providers.venice, +}); + +export const VENICE_BASE_URL = VENICE_MANIFEST_PROVIDER.baseUrl; const VENICE_DEFAULT_MODEL_ID = "kimi-k2-5"; export const VENICE_DEFAULT_MODEL_REF = `venice/${VENICE_DEFAULT_MODEL_ID}`; const VENICE_ALLOWED_HOSTNAMES = ["api.venice.ai"]; @@ -38,382 +45,9 @@ const VENICE_DISCOVERY_RETRYABLE_NETWORK_CODES = new Set([ "UND_ERR_SOCKET", ]); -export const VENICE_MODEL_CATALOG = [ - { - id: "llama-3.3-70b", - name: "Llama 3.3 70B", - reasoning: false, - input: ["text"], - contextWindow: 128000, - maxTokens: 4096, - privacy: "private", - }, - { - id: "llama-3.2-3b", - name: "Llama 3.2 3B", - reasoning: false, - input: ["text"], - contextWindow: 128000, - maxTokens: 4096, - privacy: "private", - }, - { - id: "hermes-3-llama-3.1-405b", - name: "Hermes 3 Llama 3.1 405B", - reasoning: false, - input: ["text"], - contextWindow: 128000, - maxTokens: 16384, - supportsTools: false, - privacy: "private", - }, - { - id: "qwen3-235b-a22b-thinking-2507", - name: "Qwen3 235B Thinking", - reasoning: true, - input: ["text"], - contextWindow: 128000, - maxTokens: 16384, - privacy: "private", - }, - { - id: "qwen3-235b-a22b-instruct-2507", - name: "Qwen3 235B Instruct", - reasoning: false, - input: ["text"], - contextWindow: 128000, - maxTokens: 16384, - privacy: "private", - }, - { - id: "qwen3-coder-480b-a35b-instruct", - name: "Qwen3 Coder 480B", - reasoning: false, - input: ["text"], - contextWindow: 256000, - maxTokens: 65536, - privacy: "private", - }, - { - id: "qwen3-coder-480b-a35b-instruct-turbo", - name: "Qwen3 Coder 480B Turbo", - reasoning: false, - input: ["text"], - contextWindow: 256000, - maxTokens: 65536, - privacy: "private", - }, - { - id: "qwen3-5-35b-a3b", - name: "Qwen3.5 35B A3B", - reasoning: true, - input: ["text", "image"], - contextWindow: 256000, - maxTokens: 65536, - privacy: "private", - }, - { - id: "qwen3-next-80b", - name: "Qwen3 Next 80B", - reasoning: false, - input: ["text"], - contextWindow: 256000, - maxTokens: 16384, - privacy: "private", - }, - { - id: "qwen3-vl-235b-a22b", - name: "Qwen3 VL 235B (Vision)", - reasoning: false, - input: ["text", "image"], - contextWindow: 256000, - maxTokens: 16384, - privacy: "private", - }, - { - id: "qwen3-4b", - name: "Venice Small (Qwen3 4B)", - reasoning: true, - input: ["text"], - contextWindow: 32000, - maxTokens: 4096, - privacy: "private", - }, - { - id: "deepseek-v3.2", - name: "DeepSeek V3.2", - reasoning: true, - input: ["text"], - contextWindow: 160000, - maxTokens: 32768, - supportsTools: false, - privacy: "private", - }, - { - id: "venice-uncensored", - name: "Venice Uncensored (Dolphin-Mistral)", - reasoning: false, - input: ["text"], - contextWindow: 32000, - maxTokens: 4096, - supportsTools: false, - privacy: "private", - }, - { - id: "mistral-31-24b", - name: "Venice Medium (Mistral)", - reasoning: false, - input: ["text", "image"], - contextWindow: 128000, - maxTokens: 4096, - privacy: "private", - }, - { - id: "google-gemma-3-27b-it", - name: "Google Gemma 3 27B Instruct", - reasoning: false, - input: ["text", "image"], - contextWindow: 198000, - maxTokens: 16384, - privacy: "private", - }, - { - id: "openai-gpt-oss-120b", - name: "OpenAI GPT OSS 120B", - reasoning: false, - input: ["text"], - contextWindow: 128000, - maxTokens: 16384, - privacy: "private", - }, - { - id: "nvidia-nemotron-3-nano-30b-a3b", - name: "NVIDIA Nemotron 3 Nano 30B", - reasoning: false, - input: ["text"], - contextWindow: 128000, - maxTokens: 16384, - privacy: "private", - }, - { - id: "olafangensan-glm-4.7-flash-heretic", - name: "GLM 4.7 Flash Heretic", - reasoning: true, - input: ["text"], - contextWindow: 128000, - maxTokens: 24000, - privacy: "private", - }, - { - id: "zai-org-glm-4.6", - name: "GLM 4.6", - reasoning: false, - input: ["text"], - contextWindow: 198000, - maxTokens: 16384, - privacy: "private", - }, - { - id: "zai-org-glm-4.7", - name: "GLM 4.7", - reasoning: true, - input: ["text"], - contextWindow: 198000, - maxTokens: 16384, - privacy: "private", - }, - { - id: "zai-org-glm-4.7-flash", - name: "GLM 4.7 Flash", - reasoning: true, - input: ["text"], - contextWindow: 128000, - maxTokens: 16384, - privacy: "private", - }, - { - id: "zai-org-glm-5", - name: "GLM 5", - reasoning: true, - input: ["text"], - contextWindow: 198000, - maxTokens: 32000, - privacy: "private", - }, - { - id: "kimi-k2-5", - name: "Kimi K2.5", - reasoning: true, - input: ["text", "image"], - contextWindow: 256000, - maxTokens: 65536, - privacy: "private", - }, - { - id: "kimi-k2-thinking", - name: "Kimi K2 Thinking", - reasoning: true, - input: ["text"], - contextWindow: 256000, - maxTokens: 65536, - privacy: "private", - }, - { - id: "minimax-m21", - name: "MiniMax M2.1", - reasoning: true, - input: ["text"], - contextWindow: 198000, - maxTokens: 32768, - privacy: "private", - }, - { - id: "minimax-m25", - name: "MiniMax M2.5", - reasoning: true, - input: ["text"], - contextWindow: 198000, - maxTokens: 32768, - privacy: "private", - }, - { - id: "claude-opus-4-5", - name: "Claude Opus 4.5 (via Venice)", - reasoning: true, - input: ["text", "image"], - contextWindow: 198000, - maxTokens: 32768, - privacy: "anonymized", - }, - { - id: "claude-opus-4-6", - name: "Claude Opus 4.6 (via Venice)", - reasoning: true, - input: ["text", "image"], - contextWindow: 1000000, - maxTokens: 128000, - privacy: "anonymized", - }, - { - id: "claude-sonnet-4-5", - name: "Claude Sonnet 4.5 (via Venice)", - reasoning: true, - input: ["text", "image"], - contextWindow: 198000, - maxTokens: 64000, - privacy: "anonymized", - }, - { - id: "claude-sonnet-4-6", - name: "Claude Sonnet 4.6 (via Venice)", - reasoning: true, - input: ["text", "image"], - contextWindow: 1000000, - maxTokens: 64000, - privacy: "anonymized", - }, - { - id: "openai-gpt-52", - name: "GPT-5.2 (via Venice)", - reasoning: true, - input: ["text"], - contextWindow: 256000, - maxTokens: 65536, - privacy: "anonymized", - }, - { - id: "openai-gpt-52-codex", - name: "GPT-5.2 Codex (via Venice)", - reasoning: true, - input: ["text", "image"], - contextWindow: 256000, - maxTokens: 65536, - privacy: "anonymized", - }, - { - id: "openai-gpt-53-codex", - name: "GPT-5.3 Codex (via Venice)", - reasoning: true, - input: ["text", "image"], - contextWindow: 400000, - maxTokens: 128000, - privacy: "anonymized", - }, - { - id: "openai-gpt-54", - name: "GPT-5.4 (via Venice)", - reasoning: true, - input: ["text", "image"], - contextWindow: 1000000, - maxTokens: 131072, - privacy: "anonymized", - }, - { - id: "openai-gpt-4o-2024-11-20", - name: "GPT-4o (via Venice)", - reasoning: false, - input: ["text", "image"], - contextWindow: 128000, - maxTokens: 16384, - privacy: "anonymized", - }, - { - id: "openai-gpt-4o-mini-2024-07-18", - name: "GPT-4o Mini (via Venice)", - reasoning: false, - input: ["text", "image"], - contextWindow: 128000, - maxTokens: 16384, - privacy: "anonymized", - }, - { - id: "gemini-3-pro-preview", - name: "Gemini 3 Pro (via Venice)", - reasoning: true, - input: ["text", "image"], - contextWindow: 198000, - maxTokens: 32768, - privacy: "anonymized", - }, - { - id: "gemini-3-1-pro-preview", - name: "Gemini 3.1 Pro (via Venice)", - reasoning: true, - input: ["text", "image"], - contextWindow: 1000000, - maxTokens: 32768, - privacy: "anonymized", - }, - { - id: "gemini-3-flash-preview", - name: "Gemini 3 Flash (via Venice)", - reasoning: true, - input: ["text", "image"], - contextWindow: 256000, - maxTokens: 65536, - privacy: "anonymized", - }, - { - id: "grok-41-fast", - name: "Grok 4.1 Fast (via Venice)", - reasoning: true, - input: ["text", "image"], - contextWindow: 1000000, - maxTokens: 30000, - privacy: "anonymized", - }, - { - id: "grok-code-fast-1", - name: "Grok Code Fast 1 (via Venice)", - reasoning: true, - input: ["text"], - contextWindow: 256000, - maxTokens: 10000, - privacy: "anonymized", - }, -] as const; +export const VENICE_MODEL_CATALOG: ModelDefinitionConfig[] = VENICE_MANIFEST_PROVIDER.models; -type VeniceCatalogEntry = (typeof VENICE_MODEL_CATALOG)[number]; +type VeniceCatalogEntry = ModelDefinitionConfig; export function buildVeniceModelDefinition(entry: VeniceCatalogEntry): ModelDefinitionConfig { return { @@ -426,7 +60,7 @@ export function buildVeniceModelDefinition(entry: VeniceCatalogEntry): ModelDefi maxTokens: entry.maxTokens, compat: { supportsUsageInStreaming: false, - ...("supportsTools" in entry && !entry.supportsTools ? { supportsTools: false } : {}), + ...entry.compat, }, }; }