@tyvm/knowhow 0.0.105 → 0.0.106
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONFIG.md +8 -5
- package/package.json +3 -2
- package/scripts/check-model-pricing.ts +509 -0
- package/scripts/compare-openrouter-coverage.ts +576 -0
- package/src/agents/base/base.ts +127 -2
- package/src/agents/tools/execCommand.ts +4 -0
- package/src/agents/tools/executeScript/definition.ts +1 -1
- package/src/agents/tools/index.ts +0 -1
- package/src/agents/tools/list.ts +3 -43
- package/src/agents/tools/writeFile.ts +1 -1
- package/src/auth/browserLogin.ts +9 -4
- package/src/chat/modules/RemoteSyncModule.ts +3 -0
- package/src/cli.ts +31 -1
- package/src/clients/cerebras.ts +10 -0
- package/src/clients/contextLimits.ts +7 -2
- package/src/clients/copilot.ts +23 -0
- package/src/clients/deepseek.ts +16 -0
- package/src/clients/fireworks.ts +15 -0
- package/src/clients/gemini.ts +45 -2
- package/src/clients/github.ts +16 -0
- package/src/clients/groq.ts +15 -0
- package/src/clients/http.ts +190 -6
- package/src/clients/index.ts +116 -4
- package/src/clients/llama.ts +16 -0
- package/src/clients/mistral.ts +16 -0
- package/src/clients/nvidia.ts +16 -0
- package/src/clients/openai.ts +41 -11
- package/src/clients/openrouter.ts +17 -0
- package/src/clients/pricing/anthropic.ts +105 -78
- package/src/clients/pricing/cerebras.ts +11 -0
- package/src/clients/pricing/copilot.ts +60 -0
- package/src/clients/pricing/deepseek.ts +15 -0
- package/src/clients/pricing/fireworks.ts +32 -0
- package/src/clients/pricing/github.ts +69 -0
- package/src/clients/pricing/google.ts +245 -206
- package/src/clients/pricing/groq.ts +56 -0
- package/src/clients/pricing/index.ts +42 -5
- package/src/clients/pricing/llama.ts +18 -0
- package/src/clients/pricing/mistral.ts +34 -0
- package/src/clients/pricing/models.ts +7 -236
- package/src/clients/pricing/nvidia.ts +102 -0
- package/src/clients/pricing/openai.ts +347 -171
- package/src/clients/pricing/openrouter.ts +36 -0
- package/src/clients/pricing/types.ts +83 -2
- package/src/clients/pricing/xai.ts +121 -65
- package/src/clients/types.ts +4 -0
- package/src/clients/xai.ts +150 -0
- package/src/fileSync.ts +8 -2
- package/src/login.ts +11 -3
- package/src/services/AgentSyncFs.ts +36 -12
- package/src/services/KnowhowClient.ts +11 -0
- package/src/services/LazyToolsService.ts +6 -0
- package/src/services/S3.ts +0 -7
- package/src/services/modules/index.ts +11 -2
- package/src/types.ts +56 -279
- package/src/worker.ts +174 -0
- package/tests/clients/pricing.test.ts +37 -0
- package/tests/manual/clients/completions.json +838 -226
- package/tests/manual/clients/completions.test.ts +46 -31
- package/ts_build/package.json +3 -2
- package/ts_build/src/agents/base/base.d.ts +17 -1
- package/ts_build/src/agents/base/base.js +82 -1
- package/ts_build/src/agents/base/base.js.map +1 -1
- package/ts_build/src/agents/tools/execCommand.js +3 -0
- package/ts_build/src/agents/tools/execCommand.js.map +1 -1
- package/ts_build/src/agents/tools/executeScript/definition.js +1 -1
- package/ts_build/src/agents/tools/executeScript/definition.js.map +1 -1
- package/ts_build/src/agents/tools/index.d.ts +0 -1
- package/ts_build/src/agents/tools/index.js +0 -1
- package/ts_build/src/agents/tools/index.js.map +1 -1
- package/ts_build/src/agents/tools/list.js +3 -38
- package/ts_build/src/agents/tools/list.js.map +1 -1
- package/ts_build/src/agents/tools/visionTool.d.ts +1 -1
- package/ts_build/src/agents/tools/writeFile.js +1 -1
- package/ts_build/src/agents/tools/writeFile.js.map +1 -1
- package/ts_build/src/ai.d.ts +1 -1
- package/ts_build/src/auth/browserLogin.d.ts +2 -1
- package/ts_build/src/auth/browserLogin.js +10 -3
- package/ts_build/src/auth/browserLogin.js.map +1 -1
- package/ts_build/src/chat/modules/RemoteSyncModule.js +1 -0
- package/ts_build/src/chat/modules/RemoteSyncModule.js.map +1 -1
- package/ts_build/src/cli.js +19 -0
- package/ts_build/src/cli.js.map +1 -1
- package/ts_build/src/clients/anthropic.d.ts +1 -82
- package/ts_build/src/clients/cerebras.d.ts +4 -0
- package/ts_build/src/clients/cerebras.js +14 -0
- package/ts_build/src/clients/cerebras.js.map +1 -0
- package/ts_build/src/clients/contextLimits.js +7 -2
- package/ts_build/src/clients/contextLimits.js.map +1 -1
- package/ts_build/src/clients/copilot.d.ts +4 -0
- package/ts_build/src/clients/copilot.js +15 -0
- package/ts_build/src/clients/copilot.js.map +1 -0
- package/ts_build/src/clients/deepseek.d.ts +4 -0
- package/ts_build/src/clients/deepseek.js +15 -0
- package/ts_build/src/clients/deepseek.js.map +1 -0
- package/ts_build/src/clients/fireworks.d.ts +4 -0
- package/ts_build/src/clients/fireworks.js +15 -0
- package/ts_build/src/clients/fireworks.js.map +1 -0
- package/ts_build/src/clients/gemini.d.ts +1 -0
- package/ts_build/src/clients/gemini.js +28 -1
- package/ts_build/src/clients/gemini.js.map +1 -1
- package/ts_build/src/clients/github.d.ts +4 -0
- package/ts_build/src/clients/github.js +15 -0
- package/ts_build/src/clients/github.js.map +1 -0
- package/ts_build/src/clients/groq.d.ts +4 -0
- package/ts_build/src/clients/groq.js +15 -0
- package/ts_build/src/clients/groq.js.map +1 -0
- package/ts_build/src/clients/http.d.ts +22 -1
- package/ts_build/src/clients/http.js +132 -7
- package/ts_build/src/clients/http.js.map +1 -1
- package/ts_build/src/clients/index.d.ts +14 -0
- package/ts_build/src/clients/index.js +94 -4
- package/ts_build/src/clients/index.js.map +1 -1
- package/ts_build/src/clients/llama.d.ts +4 -0
- package/ts_build/src/clients/llama.js +15 -0
- package/ts_build/src/clients/llama.js.map +1 -0
- package/ts_build/src/clients/mistral.d.ts +4 -0
- package/ts_build/src/clients/mistral.js +15 -0
- package/ts_build/src/clients/mistral.js.map +1 -0
- package/ts_build/src/clients/nvidia.d.ts +4 -0
- package/ts_build/src/clients/nvidia.js +15 -0
- package/ts_build/src/clients/nvidia.js.map +1 -0
- package/ts_build/src/clients/openai.d.ts +4 -206
- package/ts_build/src/clients/openai.js +27 -9
- package/ts_build/src/clients/openai.js.map +1 -1
- package/ts_build/src/clients/openrouter.d.ts +4 -0
- package/ts_build/src/clients/openrouter.js +15 -0
- package/ts_build/src/clients/openrouter.js.map +1 -0
- package/ts_build/src/clients/pricing/anthropic.d.ts +26 -78
- package/ts_build/src/clients/pricing/anthropic.js +75 -78
- package/ts_build/src/clients/pricing/anthropic.js.map +1 -1
- package/ts_build/src/clients/pricing/cerebras.d.ts +4 -0
- package/ts_build/src/clients/pricing/cerebras.js +11 -0
- package/ts_build/src/clients/pricing/cerebras.js.map +1 -0
- package/ts_build/src/clients/pricing/copilot.d.ts +5 -0
- package/ts_build/src/clients/pricing/copilot.js +35 -0
- package/ts_build/src/clients/pricing/copilot.js.map +1 -0
- package/ts_build/src/clients/pricing/deepseek.d.ts +5 -0
- package/ts_build/src/clients/pricing/deepseek.js +10 -0
- package/ts_build/src/clients/pricing/deepseek.js.map +1 -0
- package/ts_build/src/clients/pricing/fireworks.d.ts +5 -0
- package/ts_build/src/clients/pricing/fireworks.js +21 -0
- package/ts_build/src/clients/pricing/fireworks.js.map +1 -0
- package/ts_build/src/clients/pricing/github.d.ts +4 -0
- package/ts_build/src/clients/pricing/github.js +58 -0
- package/ts_build/src/clients/pricing/github.js.map +1 -0
- package/ts_build/src/clients/pricing/google.d.ts +59 -6
- package/ts_build/src/clients/pricing/google.js +214 -167
- package/ts_build/src/clients/pricing/google.js.map +1 -1
- package/ts_build/src/clients/pricing/groq.d.ts +5 -0
- package/ts_build/src/clients/pricing/groq.js +41 -0
- package/ts_build/src/clients/pricing/groq.js.map +1 -0
- package/ts_build/src/clients/pricing/index.d.ts +16 -5
- package/ts_build/src/clients/pricing/index.js +62 -7
- package/ts_build/src/clients/pricing/index.js.map +1 -1
- package/ts_build/src/clients/pricing/llama.d.ts +4 -0
- package/ts_build/src/clients/pricing/llama.js +14 -0
- package/ts_build/src/clients/pricing/llama.js.map +1 -0
- package/ts_build/src/clients/pricing/mistral.d.ts +5 -0
- package/ts_build/src/clients/pricing/mistral.js +23 -0
- package/ts_build/src/clients/pricing/mistral.js.map +1 -0
- package/ts_build/src/clients/pricing/models.d.ts +5 -4
- package/ts_build/src/clients/pricing/models.js +8 -162
- package/ts_build/src/clients/pricing/models.js.map +1 -1
- package/ts_build/src/clients/pricing/nvidia.d.ts +8 -0
- package/ts_build/src/clients/pricing/nvidia.js +96 -0
- package/ts_build/src/clients/pricing/nvidia.js.map +1 -0
- package/ts_build/src/clients/pricing/openai.d.ts +86 -197
- package/ts_build/src/clients/pricing/openai.js +294 -168
- package/ts_build/src/clients/pricing/openai.js.map +1 -1
- package/ts_build/src/clients/pricing/openrouter.d.ts +4 -0
- package/ts_build/src/clients/pricing/openrouter.js +29 -0
- package/ts_build/src/clients/pricing/openrouter.js.map +1 -0
- package/ts_build/src/clients/pricing/types.d.ts +27 -2
- package/ts_build/src/clients/pricing/types.js +46 -0
- package/ts_build/src/clients/pricing/types.js.map +1 -1
- package/ts_build/src/clients/pricing/xai.d.ts +37 -57
- package/ts_build/src/clients/pricing/xai.js +92 -59
- package/ts_build/src/clients/pricing/xai.js.map +1 -1
- package/ts_build/src/clients/types.d.ts +1 -0
- package/ts_build/src/clients/xai.d.ts +2 -62
- package/ts_build/src/clients/xai.js +121 -0
- package/ts_build/src/clients/xai.js.map +1 -1
- package/ts_build/src/fileSync.js +7 -2
- package/ts_build/src/fileSync.js.map +1 -1
- package/ts_build/src/login.js +8 -2
- package/ts_build/src/login.js.map +1 -1
- package/ts_build/src/services/AgentSyncFs.js +1 -0
- package/ts_build/src/services/AgentSyncFs.js.map +1 -1
- package/ts_build/src/services/KnowhowClient.d.ts +1 -0
- package/ts_build/src/services/KnowhowClient.js +7 -0
- package/ts_build/src/services/KnowhowClient.js.map +1 -1
- package/ts_build/src/services/LazyToolsService.d.ts +1 -0
- package/ts_build/src/services/LazyToolsService.js +3 -0
- package/ts_build/src/services/LazyToolsService.js.map +1 -1
- package/ts_build/src/services/S3.js +0 -7
- package/ts_build/src/services/S3.js.map +1 -1
- package/ts_build/src/services/modules/index.js +41 -1
- package/ts_build/src/services/modules/index.js.map +1 -1
- package/ts_build/src/types.d.ts +163 -124
- package/ts_build/src/types.js +33 -213
- package/ts_build/src/types.js.map +1 -1
- package/ts_build/src/worker.d.ts +4 -0
- package/ts_build/src/worker.js +140 -0
- package/ts_build/src/worker.js.map +1 -1
- package/ts_build/tests/clients/pricing.test.js +21 -0
- package/ts_build/tests/clients/pricing.test.js.map +1 -1
- package/ts_build/tests/manual/clients/completions.test.js +27 -24
- package/ts_build/tests/manual/clients/completions.test.js.map +1 -1
|
@@ -1,248 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* Pricing is in USD per 1M tokens (or per-image / per-second for media models).
|
|
6
|
-
* This is exported so the Knowhow backend (and other consumers) can import
|
|
7
|
-
* model/pricing data without duplicating it.
|
|
2
|
+
* Assembles ALL_MODEL_CATALOG from per-provider catalogs.
|
|
3
|
+
* Each provider file is the single source of truth for its models.
|
|
8
4
|
*/
|
|
9
|
-
|
|
10
|
-
import { Models, EmbeddingModels } from "../../types";
|
|
11
|
-
import { OpenAiTextPricing } from "./openai";
|
|
12
|
-
import { AnthropicTextPricing } from "./anthropic";
|
|
13
|
-
import { GeminiPricing } from "./google";
|
|
14
|
-
import { XaiTextPricing, XaiImagePricing, XaiVideoPricing } from "./xai";
|
|
15
5
|
import { ModelPricing, ModelType, ModelCatalogEntry } from "./types";
|
|
6
|
+
import { OPENAI_MODEL_CATALOG } from "./openai";
|
|
7
|
+
import { ANTHROPIC_MODEL_CATALOG } from "./anthropic";
|
|
8
|
+
import { GOOGLE_MODEL_CATALOG } from "./google";
|
|
9
|
+
import { XAI_MODEL_CATALOG } from "./xai";
|
|
16
10
|
|
|
17
11
|
export { ModelPricing, ModelType, ModelCatalogEntry };
|
|
18
12
|
|
|
19
|
-
// ─── Platform markup ──────────────────────────────────────────────────────────
|
|
20
|
-
|
|
21
13
|
/** 2.5% platform markup applied on top of all provider base rates */
|
|
22
14
|
export const USAGE_MARKUP_PERCENT = 2.5 / 100;
|
|
23
15
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
function completion(
|
|
27
|
-
id: string,
|
|
28
|
-
provider: string,
|
|
29
|
-
displayName: string,
|
|
30
|
-
pricingOverride?: Partial<ModelPricing>
|
|
31
|
-
): ModelCatalogEntry {
|
|
32
|
-
const base =
|
|
33
|
-
(OpenAiTextPricing as Record<string, Partial<ModelPricing>>)[id] ||
|
|
34
|
-
(AnthropicTextPricing as Record<string, Partial<ModelPricing>>)[id] ||
|
|
35
|
-
(GeminiPricing as Record<string, Partial<ModelPricing>>)[id] ||
|
|
36
|
-
(XaiTextPricing as Record<string, Partial<ModelPricing>>)[id] ||
|
|
37
|
-
{};
|
|
38
|
-
return {
|
|
39
|
-
id,
|
|
40
|
-
provider,
|
|
41
|
-
type: "completion",
|
|
42
|
-
displayName,
|
|
43
|
-
pricing: {
|
|
44
|
-
input: 0,
|
|
45
|
-
output: 0,
|
|
46
|
-
...base,
|
|
47
|
-
...pricingOverride,
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function embedding(
|
|
53
|
-
id: string,
|
|
54
|
-
provider: string,
|
|
55
|
-
displayName: string,
|
|
56
|
-
input: number
|
|
57
|
-
): ModelCatalogEntry {
|
|
58
|
-
return {
|
|
59
|
-
id,
|
|
60
|
-
provider,
|
|
61
|
-
type: "embedding",
|
|
62
|
-
displayName,
|
|
63
|
-
pricing: { input, output: 0 },
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
function image(
|
|
68
|
-
id: string,
|
|
69
|
-
provider: string,
|
|
70
|
-
displayName: string,
|
|
71
|
-
pricing: Partial<ModelPricing>
|
|
72
|
-
): ModelCatalogEntry {
|
|
73
|
-
return {
|
|
74
|
-
id,
|
|
75
|
-
provider,
|
|
76
|
-
type: "image",
|
|
77
|
-
displayName,
|
|
78
|
-
pricing: { input: 0, output: 0, ...pricing },
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function video(
|
|
83
|
-
id: string,
|
|
84
|
-
provider: string,
|
|
85
|
-
displayName: string,
|
|
86
|
-
video_generation: number
|
|
87
|
-
): ModelCatalogEntry {
|
|
88
|
-
return {
|
|
89
|
-
id,
|
|
90
|
-
provider,
|
|
91
|
-
type: "video",
|
|
92
|
-
displayName,
|
|
93
|
-
pricing: { input: 0, output: 0, video_generation },
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
function audio(
|
|
98
|
-
id: string,
|
|
99
|
-
provider: string,
|
|
100
|
-
displayName: string,
|
|
101
|
-
pricing: Partial<ModelPricing>
|
|
102
|
-
): ModelCatalogEntry {
|
|
103
|
-
return {
|
|
104
|
-
id,
|
|
105
|
-
provider,
|
|
106
|
-
type: "audio",
|
|
107
|
-
displayName,
|
|
108
|
-
pricing: { input: 0, output: 0, ...pricing },
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
function transaction(
|
|
113
|
-
id: string,
|
|
114
|
-
provider: string,
|
|
115
|
-
displayName: string,
|
|
116
|
-
pricing: Partial<ModelPricing>
|
|
117
|
-
): ModelCatalogEntry {
|
|
118
|
-
return {
|
|
119
|
-
id,
|
|
120
|
-
provider,
|
|
121
|
-
type: "transaction",
|
|
122
|
-
displayName,
|
|
123
|
-
pricing: { input: 0, output: 0, ...pricing },
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// ─── OpenAI ───────────────────────────────────────────────────────────────────
|
|
128
|
-
|
|
129
|
-
export const OPENAI_MODEL_CATALOG: ModelCatalogEntry[] = [
|
|
130
|
-
// Completion
|
|
131
|
-
completion(Models.openai.GPT_4o, "openai", "GPT-4o"),
|
|
132
|
-
completion(Models.openai.GPT_4o_Mini, "openai", "GPT-4o Mini"),
|
|
133
|
-
completion(Models.openai.GPT_41, "openai", "GPT-4.1"),
|
|
134
|
-
completion(Models.openai.GPT_41_Mini, "openai", "GPT-4.1 Mini"),
|
|
135
|
-
completion(Models.openai.GPT_41_Nano, "openai", "GPT-4.1 Nano"),
|
|
136
|
-
completion(Models.openai.GPT_45, "openai", "GPT-4.5 Preview"),
|
|
137
|
-
completion(Models.openai.o1, "openai", "o1"),
|
|
138
|
-
completion(Models.openai.o1_Mini, "openai", "o1 Mini"),
|
|
139
|
-
completion(Models.openai.o3, "openai", "o3"),
|
|
140
|
-
completion(Models.openai.o3_Mini, "openai", "o3 Mini"),
|
|
141
|
-
completion(Models.openai.o4_Mini, "openai", "o4 Mini"),
|
|
142
|
-
// Embedding
|
|
143
|
-
embedding(EmbeddingModels.openai.EmbeddingAda2, "openai", "Embedding Ada 002", OpenAiTextPricing[EmbeddingModels.openai.EmbeddingAda2]?.input ?? 0.1),
|
|
144
|
-
embedding(EmbeddingModels.openai.EmbeddingLarge3, "openai", "Embedding 3 Large", OpenAiTextPricing[EmbeddingModels.openai.EmbeddingLarge3]?.input ?? 0.13),
|
|
145
|
-
embedding(EmbeddingModels.openai.EmbeddingSmall3, "openai", "Embedding 3 Small", OpenAiTextPricing[EmbeddingModels.openai.EmbeddingSmall3]?.input ?? 0.02),
|
|
146
|
-
// Image generation
|
|
147
|
-
image(Models.openai.DALL_E_3, "openai", "DALL-E 3", { image_generation: 0.04 }),
|
|
148
|
-
image(Models.openai.DALL_E_2, "openai", "DALL-E 2", { image_generation: 0.02 }),
|
|
149
|
-
image(Models.openai.GPT_Image_15, "openai", "GPT Image 1.5", { input: OpenAiTextPricing[Models.openai.GPT_Image_15]?.input ?? 5.0, output: OpenAiTextPricing[Models.openai.GPT_Image_15]?.output ?? 10.0 }),
|
|
150
|
-
image(Models.openai.GPT_Image_1_Mini, "openai", "GPT Image 1 Mini", { input: OpenAiTextPricing[Models.openai.GPT_Image_1_Mini]?.input ?? 2.0 }),
|
|
151
|
-
// Video generation
|
|
152
|
-
video(Models.openai.Sora, "openai", "Sora", 0.012),
|
|
153
|
-
video(Models.openai.Sora_2, "openai", "Sora 2", 0.015),
|
|
154
|
-
// Audio
|
|
155
|
-
audio(Models.openai.TTS_1, "openai", "TTS-1", { input: 15.0 }),
|
|
156
|
-
audio(Models.openai.Whisper_1, "openai", "Whisper 1", { input: 0.006 }),
|
|
157
|
-
// Transaction / Search
|
|
158
|
-
transaction(Models.openai.GPT_4o_Mini_Search, "openai", "GPT-4o Mini Search", { input: OpenAiTextPricing[Models.openai.GPT_4o_Mini_Search]?.input ?? 0.15, output: OpenAiTextPricing[Models.openai.GPT_4o_Mini_Search]?.output ?? 0.6 }),
|
|
159
|
-
transaction(Models.openai.GPT_4o_Search, "openai", "GPT-4o Search", { input: OpenAiTextPricing[Models.openai.GPT_4o_Search]?.input ?? 2.5, output: OpenAiTextPricing[Models.openai.GPT_4o_Search]?.output ?? 10.0 }),
|
|
160
|
-
];
|
|
161
|
-
|
|
162
|
-
// ─── Anthropic ────────────────────────────────────────────────────────────────
|
|
163
|
-
|
|
164
|
-
export const ANTHROPIC_MODEL_CATALOG: ModelCatalogEntry[] = [
|
|
165
|
-
completion(Models.anthropic.Opus4_5, "anthropic", "Claude Opus 4.5"),
|
|
166
|
-
completion(Models.anthropic.Sonnet4_5, "anthropic", "Claude Sonnet 4.5"),
|
|
167
|
-
completion(Models.anthropic.Opus4, "anthropic", "Claude Opus 4"),
|
|
168
|
-
completion(Models.anthropic.Sonnet4, "anthropic", "Claude Sonnet 4"),
|
|
169
|
-
completion(Models.anthropic.Haiku4_5, "anthropic", "Claude Haiku 4.5"),
|
|
170
|
-
completion(Models.anthropic.Sonnet3_7, "anthropic", "Claude Sonnet 3.7"),
|
|
171
|
-
completion(Models.anthropic.Sonnet3_5, "anthropic", "Claude Sonnet 3.5"),
|
|
172
|
-
completion(Models.anthropic.Haiku3, "anthropic", "Claude Haiku 3"),
|
|
173
|
-
completion(Models.anthropic.Opus3, "anthropic", "Claude Opus 3"),
|
|
174
|
-
];
|
|
175
|
-
|
|
176
|
-
// ─── Google ───────────────────────────────────────────────────────────────────
|
|
177
|
-
|
|
178
|
-
export const GOOGLE_MODEL_CATALOG: ModelCatalogEntry[] = [
|
|
179
|
-
// Completion
|
|
180
|
-
completion(Models.google.Gemini_25_Pro, "google", "Gemini 2.5 Pro"),
|
|
181
|
-
completion(Models.google.Gemini_25_Flash, "google", "Gemini 2.5 Flash"),
|
|
182
|
-
completion(Models.google.Gemini_25_Flash_Lite, "google", "Gemini 2.5 Flash Lite"),
|
|
183
|
-
completion(Models.google.Gemini_20_Flash, "google", "Gemini 2.0 Flash"),
|
|
184
|
-
completion(Models.google.Gemini_15_Pro, "google", "Gemini 1.5 Pro"),
|
|
185
|
-
completion(Models.google.Gemini_15_Flash, "google", "Gemini 1.5 Flash"),
|
|
186
|
-
completion(Models.google.Gemini_15_Flash_8B, "google", "Gemini 1.5 Flash 8B"),
|
|
187
|
-
// Embedding
|
|
188
|
-
embedding(EmbeddingModels.google.Gemini_Embedding, "google", "Gemini Embedding", GeminiPricing[EmbeddingModels.google.Gemini_Embedding]?.input ?? 0),
|
|
189
|
-
// Image generation
|
|
190
|
-
image(Models.google.Gemini_20_Flash_Preview_Image_Generation, "google", "Gemini 2.0 Flash Image", {
|
|
191
|
-
input: GeminiPricing[Models.google.Gemini_20_Flash_Preview_Image_Generation]?.input ?? 0.1,
|
|
192
|
-
output: GeminiPricing[Models.google.Gemini_20_Flash_Preview_Image_Generation]?.output ?? 0.4,
|
|
193
|
-
image_generation: GeminiPricing[Models.google.Gemini_20_Flash_Preview_Image_Generation]?.image_generation ?? 0.039,
|
|
194
|
-
}),
|
|
195
|
-
image(Models.google.Gemini_25_Flash_Image, "google", "Gemini 2.5 Flash Image", {
|
|
196
|
-
input: GeminiPricing[Models.google.Gemini_25_Flash_Image]?.input ?? 0.3,
|
|
197
|
-
output: GeminiPricing[Models.google.Gemini_25_Flash_Image]?.output ?? 0.039,
|
|
198
|
-
image_generation: GeminiPricing[Models.google.Gemini_25_Flash_Image]?.image_generation ?? 0.039,
|
|
199
|
-
}),
|
|
200
|
-
image(Models.google.Gemini_31_Flash_Image_Preview, "google", "Gemini 3.1 Flash Image", {
|
|
201
|
-
input: GeminiPricing[Models.google.Gemini_31_Flash_Image_Preview]?.input ?? 0.5,
|
|
202
|
-
output: GeminiPricing[Models.google.Gemini_31_Flash_Image_Preview]?.output ?? 3.0,
|
|
203
|
-
image_generation: GeminiPricing[Models.google.Gemini_31_Flash_Image_Preview]?.image_generation ?? 0.045,
|
|
204
|
-
}),
|
|
205
|
-
image(Models.google.Gemini_3_Pro_Image_Preview, "google", "Gemini 3 Pro Image", {
|
|
206
|
-
input: GeminiPricing[Models.google.Gemini_3_Pro_Image_Preview]?.input ?? 2.0,
|
|
207
|
-
output: GeminiPricing[Models.google.Gemini_3_Pro_Image_Preview]?.output ?? 12.0,
|
|
208
|
-
image_generation: GeminiPricing[Models.google.Gemini_3_Pro_Image_Preview]?.image_generation ?? 0.134,
|
|
209
|
-
}),
|
|
210
|
-
image(Models.google.Imagen_3, "google", "Imagen 4", { image_generation: GeminiPricing[Models.google.Imagen_3]?.image_generation ?? 0.04 }),
|
|
211
|
-
image(Models.google.Imagen_4_Fast, "google", "Imagen 4 Fast", { image_generation: GeminiPricing[Models.google.Imagen_4_Fast]?.image_generation ?? 0.02 }),
|
|
212
|
-
image(Models.google.Imagen_4_Ultra, "google", "Imagen 4 Ultra", { image_generation: GeminiPricing[Models.google.Imagen_4_Ultra]?.image_generation ?? 0.06 }),
|
|
213
|
-
// Video generation
|
|
214
|
-
video(Models.google.Veo_2, "google", "Veo 2", GeminiPricing[Models.google.Veo_2]?.video_generation ?? 0.35),
|
|
215
|
-
video(Models.google.Veo_3, "google", "Veo 3", GeminiPricing[Models.google.Veo_3]?.video_generation ?? 0.4),
|
|
216
|
-
video(Models.google.Veo_3_Fast, "google", "Veo 3 Fast", GeminiPricing[Models.google.Veo_3_Fast]?.video_generation ?? 0.1),
|
|
217
|
-
// Audio (TTS)
|
|
218
|
-
audio(Models.google.Gemini_25_Flash_TTS, "google", "Gemini 2.5 Flash TTS", {
|
|
219
|
-
input: GeminiPricing[Models.google.Gemini_25_Flash_TTS]?.input ?? 0.5,
|
|
220
|
-
output_audio: GeminiPricing[Models.google.Gemini_25_Flash_TTS]?.output_audio ?? 10.0,
|
|
221
|
-
output: GeminiPricing[Models.google.Gemini_25_Flash_TTS]?.output_audio ?? 10.0,
|
|
222
|
-
}),
|
|
223
|
-
audio(Models.google.Gemini_25_Pro_TTS, "google", "Gemini 2.5 Pro TTS", {
|
|
224
|
-
input: GeminiPricing[Models.google.Gemini_25_Pro_TTS]?.input ?? 1.0,
|
|
225
|
-
output_audio: GeminiPricing[Models.google.Gemini_25_Pro_TTS]?.output_audio ?? 20.0,
|
|
226
|
-
output: GeminiPricing[Models.google.Gemini_25_Pro_TTS]?.output_audio ?? 20.0,
|
|
227
|
-
}),
|
|
228
|
-
];
|
|
229
|
-
|
|
230
|
-
// ─── xAI ──────────────────────────────────────────────────────────────────────
|
|
231
|
-
|
|
232
|
-
export const XAI_MODEL_CATALOG: ModelCatalogEntry[] = [
|
|
233
|
-
completion(Models.xai.Grok4, "xai", "Grok 4"),
|
|
234
|
-
completion(Models.xai.Grok3Beta, "xai", "Grok 3 Beta"),
|
|
235
|
-
completion(Models.xai.Grok3MiniBeta, "xai", "Grok 3 Mini Beta"),
|
|
236
|
-
completion(Models.xai.Grok3FastBeta, "xai", "Grok 3 Fast Beta"),
|
|
237
|
-
completion(Models.xai.Grok21212, "xai", "Grok 2"),
|
|
238
|
-
// Image generation
|
|
239
|
-
image(Models.xai.GrokImagineImage, "xai", "Grok Imagine Image", { image_generation: XaiImagePricing["grok-imagine-image"]?.image_generation ?? 0.02 }),
|
|
240
|
-
image("grok-2-image-1212", "xai", "Grok 2 Image", { image_generation: XaiImagePricing["grok-2-image-1212"]?.image_generation ?? 0.07 }),
|
|
241
|
-
// Video generation
|
|
242
|
-
video(Models.xai.GrokImagineVideo, "xai", "Grok Imagine Video", XaiVideoPricing["grok-imagine-video"]?.video_generation ?? 0.05),
|
|
243
|
-
];
|
|
244
|
-
|
|
245
|
-
// ─── Combined catalog ─────────────────────────────────────────────────────────
|
|
16
|
+
export { OPENAI_MODEL_CATALOG, ANTHROPIC_MODEL_CATALOG, GOOGLE_MODEL_CATALOG, XAI_MODEL_CATALOG };
|
|
246
17
|
|
|
247
18
|
export const ALL_MODEL_CATALOG: ModelCatalogEntry[] = [
|
|
248
19
|
...OPENAI_MODEL_CATALOG,
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NVIDIA NIM pricing (USD per 1M tokens)
|
|
3
|
+
* Source: https://build.nvidia.com/explore/discover
|
|
4
|
+
* Many models are free (marked $0). Paid models use credit-based pricing.
|
|
5
|
+
*/
|
|
6
|
+
export const NvidiaTextPricing: Record<string, { input: number; output: number }> = {
|
|
7
|
+
// Free models
|
|
8
|
+
"meta/llama-3.1-8b-instruct": { input: 0.0, output: 0.0 },
|
|
9
|
+
"meta/llama-3.1-70b-instruct": { input: 0.0, output: 0.0 },
|
|
10
|
+
"meta/llama-3.1-405b-instruct": { input: 0.0, output: 0.0 },
|
|
11
|
+
"meta/llama-3.3-70b-instruct": { input: 0.0, output: 0.0 },
|
|
12
|
+
"meta/llama-4-scout-17b-16e-instruct": { input: 0.0, output: 0.0 },
|
|
13
|
+
"meta/llama-4-maverick-17b-128e-instruct": { input: 0.0, output: 0.0 },
|
|
14
|
+
"mistralai/mistral-7b-instruct-v0.3": { input: 0.0, output: 0.0 },
|
|
15
|
+
"mistralai/mixtral-8x7b-instruct-v0.1": { input: 0.0, output: 0.0 },
|
|
16
|
+
"mistralai/codestral-22b-instruct-v0.1": { input: 0.0, output: 0.0 },
|
|
17
|
+
"microsoft/phi-4-mini-instruct": { input: 0.0, output: 0.0 },
|
|
18
|
+
"microsoft/phi-4-multimodal-instruct": { input: 0.0, output: 0.0 },
|
|
19
|
+
"microsoft/phi-3-medium-128k-instruct": { input: 0.0, output: 0.0 },
|
|
20
|
+
"microsoft/phi-3-medium-4k-instruct": { input: 0.0, output: 0.0 },
|
|
21
|
+
"microsoft/phi-3-small-128k-instruct": { input: 0.0, output: 0.0 },
|
|
22
|
+
"microsoft/phi-3-small-8k-instruct": { input: 0.0, output: 0.0 },
|
|
23
|
+
"microsoft/phi-3-vision-128k-instruct": { input: 0.0, output: 0.0 },
|
|
24
|
+
"microsoft/phi-3.5-moe-instruct": { input: 0.0, output: 0.0 },
|
|
25
|
+
"microsoft/phi-3.5-vision-instruct": { input: 0.0, output: 0.0 },
|
|
26
|
+
"qwen/qwen2.5-7b-instruct": { input: 0.0, output: 0.0 },
|
|
27
|
+
"qwen/qwen2.5-72b-instruct": { input: 0.0, output: 0.0 },
|
|
28
|
+
"qwen/qwen2.5-coder-32b-instruct": { input: 0.0, output: 0.0 },
|
|
29
|
+
"qwen/qwen2.5-coder-7b-instruct": { input: 0.0, output: 0.0 },
|
|
30
|
+
"qwen/qwen3-235b-a22b": { input: 0.0, output: 0.0 },
|
|
31
|
+
"qwen/qwen3-coder-480b-a35b-instruct": { input: 0.0, output: 0.0 },
|
|
32
|
+
"qwen/qwen3-next-80b-a3b-instruct": { input: 0.0, output: 0.0 },
|
|
33
|
+
"qwen/qwen3-next-80b-a3b-thinking": { input: 0.0, output: 0.0 },
|
|
34
|
+
"qwen/qwen3.5-397b-a17b": { input: 0.0, output: 0.0 },
|
|
35
|
+
"qwen/qwq-32b": { input: 0.0, output: 0.0 },
|
|
36
|
+
"deepseek-ai/deepseek-r1": { input: 0.0, output: 0.0 },
|
|
37
|
+
"deepseek-ai/deepseek-r1-0528": { input: 0.0, output: 0.0 },
|
|
38
|
+
"deepseek-ai/deepseek-coder-6.7b-instruct": { input: 0.0, output: 0.0 },
|
|
39
|
+
"deepseek-ai/deepseek-v3.1": { input: 0.0, output: 0.0 },
|
|
40
|
+
"deepseek-ai/deepseek-v4-flash": { input: 0.14, output: 0.28 },
|
|
41
|
+
"deepseek-ai/deepseek-v3.1-terminus": { input: 0.0, output: 0.0 },
|
|
42
|
+
"deepseek-ai/deepseek-v3.2": { input: 0.0, output: 0.0 },
|
|
43
|
+
"nvidia/llama-3.1-nemotron-70b-instruct": { input: 0.0, output: 0.0 },
|
|
44
|
+
"nvidia/llama-3.1-nemotron-51b-instruct": { input: 0.0, output: 0.0 },
|
|
45
|
+
"nvidia/llama-3.1-nemotron-ultra-253b-v1": { input: 0.0, output: 0.0 },
|
|
46
|
+
"nvidia/llama-3.3-nemotron-super-49b-v1": { input: 0.0, output: 0.0 },
|
|
47
|
+
"nvidia/llama-3.3-nemotron-super-49b-v1.5": { input: 0.0, output: 0.0 },
|
|
48
|
+
"nvidia/llama-embed-nemotron-8b": { input: 0.0, output: 0.0 },
|
|
49
|
+
"nvidia/llama3-chatqa-1.5-70b": { input: 0.0, output: 0.0 },
|
|
50
|
+
"nvidia/cosmos-nemotron-34b": { input: 0.0, output: 0.0 },
|
|
51
|
+
"nvidia/nemoretriever-ocr-v1": { input: 0.0, output: 0.0 },
|
|
52
|
+
"nvidia/nemotron-3-nano-30b-a3b": { input: 0.0, output: 0.0 },
|
|
53
|
+
"nvidia/nvidia-nemotron-nano-9b-v2": { input: 0.0, output: 0.0 },
|
|
54
|
+
"nvidia/parakeet-tdt-0.6b-v2": { input: 0.0, output: 0.0 },
|
|
55
|
+
"google/gemma-3-27b-it": { input: 0.0, output: 0.0 },
|
|
56
|
+
"google/gemma-3-12b-it": { input: 0.0, output: 0.0 },
|
|
57
|
+
"google/gemma-3-4b-it": { input: 0.0, output: 0.0 },
|
|
58
|
+
"google/gemma-3-1b-it": { input: 0.0, output: 0.0 },
|
|
59
|
+
"google/gemma-3n-e2b-it": { input: 0.0, output: 0.0 },
|
|
60
|
+
"google/gemma-3n-e4b-it": { input: 0.0, output: 0.0 },
|
|
61
|
+
"google/gemma-4-31b-it": { input: 0.0, output: 0.0 },
|
|
62
|
+
"google/gemma-2-27b-it": { input: 0.0, output: 0.0 },
|
|
63
|
+
"google/gemma-2-2b-it": { input: 0.0, output: 0.0 },
|
|
64
|
+
"google/codegemma-1.1-7b": { input: 0.0, output: 0.0 },
|
|
65
|
+
"google/codegemma-7b": { input: 0.0, output: 0.0 },
|
|
66
|
+
"meta/llama-3.2-11b-vision-instruct": { input: 0.0, output: 0.0 },
|
|
67
|
+
"meta/llama-3.2-1b-instruct": { input: 0.0, output: 0.0 },
|
|
68
|
+
"meta/llama3-70b-instruct": { input: 0.0, output: 0.0 },
|
|
69
|
+
"meta/llama3-8b-instruct": { input: 0.0, output: 0.0 },
|
|
70
|
+
"meta/codellama-70b": { input: 0.0, output: 0.0 },
|
|
71
|
+
"mistralai/mistral-large-2-instruct": { input: 0.0, output: 0.0 },
|
|
72
|
+
"mistralai/mistral-large-3-675b-instruct-2512": { input: 0.0, output: 0.0 },
|
|
73
|
+
"mistralai/mistral-small-3.1-24b-instruct-2503": { input: 0.0, output: 0.0 },
|
|
74
|
+
"mistralai/ministral-14b-instruct-2512": { input: 0.0, output: 0.0 },
|
|
75
|
+
"mistralai/mamba-codestral-7b-v0.1": { input: 0.0, output: 0.0 },
|
|
76
|
+
"mistralai/devstral-2-123b-instruct-2512": { input: 0.0, output: 0.0 },
|
|
77
|
+
"minimaxai/minimax-m2.1": { input: 0.0, output: 0.0 },
|
|
78
|
+
"minimaxai/minimax-m2.5": { input: 0.0, output: 0.0 },
|
|
79
|
+
"minimaxai/minimax-m2.7": { input: 0.0, output: 0.0 },
|
|
80
|
+
"moonshotai/kimi-k2-instruct": { input: 0.0, output: 0.0 },
|
|
81
|
+
"moonshotai/kimi-k2-instruct-0905": { input: 0.0, output: 0.0 },
|
|
82
|
+
"moonshotai/kimi-k2-thinking": { input: 0.0, output: 0.0 },
|
|
83
|
+
"moonshotai/kimi-k2.5": { input: 0.0, output: 0.0 },
|
|
84
|
+
"openai/gpt-oss-120b": { input: 0.0, output: 0.0 },
|
|
85
|
+
"openai/whisper-large-v3": { input: 0.0, output: 0.0 },
|
|
86
|
+
"stepfun-ai/step-3.5-flash": { input: 0.0, output: 0.0 },
|
|
87
|
+
"z-ai/glm-5.1": { input: 0.0, output: 0.0 },
|
|
88
|
+
"z-ai/glm4.7": { input: 0.0, output: 0.0 },
|
|
89
|
+
"z-ai/glm5": { input: 0.0, output: 0.0 },
|
|
90
|
+
// Nemotron 4 340B — free on NVIDIA NIM platform
|
|
91
|
+
// Source: models.dev (cost: $0), build.nvidia.com (free sign-up, no credit card)
|
|
92
|
+
"nvidia/nemotron-4-340b-instruct": { input: 0.0, output: 0.0 },
|
|
93
|
+
// Paid models
|
|
94
|
+
"deepseek-ai/deepseek-v4-pro": { input: 1.74, output: 3.48 },
|
|
95
|
+
"nvidia/nemotron-3-super-120b-a12b": { input: 0.2, output: 0.8 },
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export const NvidiaImagePricing: Record<string, { input: number; output: number }> = {
|
|
99
|
+
"black-forest-labs/flux.1-dev": { input: 0.0, output: 0.0 },
|
|
100
|
+
"black-forest-labs/flux.1-schnell": { input: 0.0, output: 0.0 },
|
|
101
|
+
"stabilityai/stable-diffusion-3.5-medium": { input: 0.0, output: 0.0 },
|
|
102
|
+
};
|