|
| 1 | +import { buildManifestModelProviderConfig } from "openclaw/plugin-sdk/provider-catalog-shared"; |
1 | 2 | import type { ModelProviderConfig } from "openclaw/plugin-sdk/provider-model-shared"; |
2 | | - |
3 | | -const NVIDIA_BASE_URL = "https://integrate.api.nvidia.com/v1"; |
4 | | -const NVIDIA_DEFAULT_MODEL_ID = "nvidia/nemotron-3-super-120b-a12b"; |
5 | | -const NVIDIA_DEFAULT_MAX_TOKENS = 8192; |
6 | | -const NVIDIA_DEFAULT_COST = { |
7 | | -input: 0, |
8 | | -output: 0, |
9 | | -cacheRead: 0, |
10 | | -cacheWrite: 0, |
11 | | -}; |
| 3 | +import manifest from "./openclaw.plugin.json" with { type: "json" }; |
12 | 4 | |
13 | 5 | export function buildNvidiaProvider(): ModelProviderConfig { |
14 | | -return { |
15 | | -baseUrl: NVIDIA_BASE_URL, |
16 | | -api: "openai-completions", |
17 | | -models: [ |
18 | | -{ |
19 | | -id: NVIDIA_DEFAULT_MODEL_ID, |
20 | | -name: "NVIDIA Nemotron 3 Super 120B", |
21 | | -reasoning: false, |
22 | | -input: ["text"], |
23 | | -cost: NVIDIA_DEFAULT_COST, |
24 | | -contextWindow: 262144, |
25 | | -maxTokens: NVIDIA_DEFAULT_MAX_TOKENS, |
26 | | -}, |
27 | | -{ |
28 | | -id: "moonshotai/kimi-k2.5", |
29 | | -name: "Kimi K2.5", |
30 | | -reasoning: false, |
31 | | -input: ["text"], |
32 | | -cost: NVIDIA_DEFAULT_COST, |
33 | | -contextWindow: 262144, |
34 | | -maxTokens: NVIDIA_DEFAULT_MAX_TOKENS, |
35 | | -}, |
36 | | -{ |
37 | | -id: "minimaxai/minimax-m2.5", |
38 | | -name: "MiniMax M2.5", |
39 | | -reasoning: false, |
40 | | -input: ["text"], |
41 | | -cost: NVIDIA_DEFAULT_COST, |
42 | | -contextWindow: 196608, |
43 | | -maxTokens: NVIDIA_DEFAULT_MAX_TOKENS, |
44 | | -}, |
45 | | -{ |
46 | | -id: "z-ai/glm5", |
47 | | -name: "GLM-5", |
48 | | -reasoning: false, |
49 | | -input: ["text"], |
50 | | -cost: NVIDIA_DEFAULT_COST, |
51 | | -contextWindow: 202752, |
52 | | -maxTokens: NVIDIA_DEFAULT_MAX_TOKENS, |
53 | | -}, |
54 | | -], |
55 | | -}; |
| 6 | +return buildManifestModelProviderConfig({ |
| 7 | +providerId: "nvidia", |
| 8 | +catalog: manifest.modelCatalog.providers.nvidia, |
| 9 | +}); |
56 | 10 | } |