@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.
Files changed (209) hide show
  1. package/CONFIG.md +8 -5
  2. package/package.json +3 -2
  3. package/scripts/check-model-pricing.ts +509 -0
  4. package/scripts/compare-openrouter-coverage.ts +576 -0
  5. package/src/agents/base/base.ts +127 -2
  6. package/src/agents/tools/execCommand.ts +4 -0
  7. package/src/agents/tools/executeScript/definition.ts +1 -1
  8. package/src/agents/tools/index.ts +0 -1
  9. package/src/agents/tools/list.ts +3 -43
  10. package/src/agents/tools/writeFile.ts +1 -1
  11. package/src/auth/browserLogin.ts +9 -4
  12. package/src/chat/modules/RemoteSyncModule.ts +3 -0
  13. package/src/cli.ts +31 -1
  14. package/src/clients/cerebras.ts +10 -0
  15. package/src/clients/contextLimits.ts +7 -2
  16. package/src/clients/copilot.ts +23 -0
  17. package/src/clients/deepseek.ts +16 -0
  18. package/src/clients/fireworks.ts +15 -0
  19. package/src/clients/gemini.ts +45 -2
  20. package/src/clients/github.ts +16 -0
  21. package/src/clients/groq.ts +15 -0
  22. package/src/clients/http.ts +190 -6
  23. package/src/clients/index.ts +116 -4
  24. package/src/clients/llama.ts +16 -0
  25. package/src/clients/mistral.ts +16 -0
  26. package/src/clients/nvidia.ts +16 -0
  27. package/src/clients/openai.ts +41 -11
  28. package/src/clients/openrouter.ts +17 -0
  29. package/src/clients/pricing/anthropic.ts +105 -78
  30. package/src/clients/pricing/cerebras.ts +11 -0
  31. package/src/clients/pricing/copilot.ts +60 -0
  32. package/src/clients/pricing/deepseek.ts +15 -0
  33. package/src/clients/pricing/fireworks.ts +32 -0
  34. package/src/clients/pricing/github.ts +69 -0
  35. package/src/clients/pricing/google.ts +245 -206
  36. package/src/clients/pricing/groq.ts +56 -0
  37. package/src/clients/pricing/index.ts +42 -5
  38. package/src/clients/pricing/llama.ts +18 -0
  39. package/src/clients/pricing/mistral.ts +34 -0
  40. package/src/clients/pricing/models.ts +7 -236
  41. package/src/clients/pricing/nvidia.ts +102 -0
  42. package/src/clients/pricing/openai.ts +347 -171
  43. package/src/clients/pricing/openrouter.ts +36 -0
  44. package/src/clients/pricing/types.ts +83 -2
  45. package/src/clients/pricing/xai.ts +121 -65
  46. package/src/clients/types.ts +4 -0
  47. package/src/clients/xai.ts +150 -0
  48. package/src/fileSync.ts +8 -2
  49. package/src/login.ts +11 -3
  50. package/src/services/AgentSyncFs.ts +36 -12
  51. package/src/services/KnowhowClient.ts +11 -0
  52. package/src/services/LazyToolsService.ts +6 -0
  53. package/src/services/S3.ts +0 -7
  54. package/src/services/modules/index.ts +11 -2
  55. package/src/types.ts +56 -279
  56. package/src/worker.ts +174 -0
  57. package/tests/clients/pricing.test.ts +37 -0
  58. package/tests/manual/clients/completions.json +838 -226
  59. package/tests/manual/clients/completions.test.ts +46 -31
  60. package/ts_build/package.json +3 -2
  61. package/ts_build/src/agents/base/base.d.ts +17 -1
  62. package/ts_build/src/agents/base/base.js +82 -1
  63. package/ts_build/src/agents/base/base.js.map +1 -1
  64. package/ts_build/src/agents/tools/execCommand.js +3 -0
  65. package/ts_build/src/agents/tools/execCommand.js.map +1 -1
  66. package/ts_build/src/agents/tools/executeScript/definition.js +1 -1
  67. package/ts_build/src/agents/tools/executeScript/definition.js.map +1 -1
  68. package/ts_build/src/agents/tools/index.d.ts +0 -1
  69. package/ts_build/src/agents/tools/index.js +0 -1
  70. package/ts_build/src/agents/tools/index.js.map +1 -1
  71. package/ts_build/src/agents/tools/list.js +3 -38
  72. package/ts_build/src/agents/tools/list.js.map +1 -1
  73. package/ts_build/src/agents/tools/visionTool.d.ts +1 -1
  74. package/ts_build/src/agents/tools/writeFile.js +1 -1
  75. package/ts_build/src/agents/tools/writeFile.js.map +1 -1
  76. package/ts_build/src/ai.d.ts +1 -1
  77. package/ts_build/src/auth/browserLogin.d.ts +2 -1
  78. package/ts_build/src/auth/browserLogin.js +10 -3
  79. package/ts_build/src/auth/browserLogin.js.map +1 -1
  80. package/ts_build/src/chat/modules/RemoteSyncModule.js +1 -0
  81. package/ts_build/src/chat/modules/RemoteSyncModule.js.map +1 -1
  82. package/ts_build/src/cli.js +19 -0
  83. package/ts_build/src/cli.js.map +1 -1
  84. package/ts_build/src/clients/anthropic.d.ts +1 -82
  85. package/ts_build/src/clients/cerebras.d.ts +4 -0
  86. package/ts_build/src/clients/cerebras.js +14 -0
  87. package/ts_build/src/clients/cerebras.js.map +1 -0
  88. package/ts_build/src/clients/contextLimits.js +7 -2
  89. package/ts_build/src/clients/contextLimits.js.map +1 -1
  90. package/ts_build/src/clients/copilot.d.ts +4 -0
  91. package/ts_build/src/clients/copilot.js +15 -0
  92. package/ts_build/src/clients/copilot.js.map +1 -0
  93. package/ts_build/src/clients/deepseek.d.ts +4 -0
  94. package/ts_build/src/clients/deepseek.js +15 -0
  95. package/ts_build/src/clients/deepseek.js.map +1 -0
  96. package/ts_build/src/clients/fireworks.d.ts +4 -0
  97. package/ts_build/src/clients/fireworks.js +15 -0
  98. package/ts_build/src/clients/fireworks.js.map +1 -0
  99. package/ts_build/src/clients/gemini.d.ts +1 -0
  100. package/ts_build/src/clients/gemini.js +28 -1
  101. package/ts_build/src/clients/gemini.js.map +1 -1
  102. package/ts_build/src/clients/github.d.ts +4 -0
  103. package/ts_build/src/clients/github.js +15 -0
  104. package/ts_build/src/clients/github.js.map +1 -0
  105. package/ts_build/src/clients/groq.d.ts +4 -0
  106. package/ts_build/src/clients/groq.js +15 -0
  107. package/ts_build/src/clients/groq.js.map +1 -0
  108. package/ts_build/src/clients/http.d.ts +22 -1
  109. package/ts_build/src/clients/http.js +132 -7
  110. package/ts_build/src/clients/http.js.map +1 -1
  111. package/ts_build/src/clients/index.d.ts +14 -0
  112. package/ts_build/src/clients/index.js +94 -4
  113. package/ts_build/src/clients/index.js.map +1 -1
  114. package/ts_build/src/clients/llama.d.ts +4 -0
  115. package/ts_build/src/clients/llama.js +15 -0
  116. package/ts_build/src/clients/llama.js.map +1 -0
  117. package/ts_build/src/clients/mistral.d.ts +4 -0
  118. package/ts_build/src/clients/mistral.js +15 -0
  119. package/ts_build/src/clients/mistral.js.map +1 -0
  120. package/ts_build/src/clients/nvidia.d.ts +4 -0
  121. package/ts_build/src/clients/nvidia.js +15 -0
  122. package/ts_build/src/clients/nvidia.js.map +1 -0
  123. package/ts_build/src/clients/openai.d.ts +4 -206
  124. package/ts_build/src/clients/openai.js +27 -9
  125. package/ts_build/src/clients/openai.js.map +1 -1
  126. package/ts_build/src/clients/openrouter.d.ts +4 -0
  127. package/ts_build/src/clients/openrouter.js +15 -0
  128. package/ts_build/src/clients/openrouter.js.map +1 -0
  129. package/ts_build/src/clients/pricing/anthropic.d.ts +26 -78
  130. package/ts_build/src/clients/pricing/anthropic.js +75 -78
  131. package/ts_build/src/clients/pricing/anthropic.js.map +1 -1
  132. package/ts_build/src/clients/pricing/cerebras.d.ts +4 -0
  133. package/ts_build/src/clients/pricing/cerebras.js +11 -0
  134. package/ts_build/src/clients/pricing/cerebras.js.map +1 -0
  135. package/ts_build/src/clients/pricing/copilot.d.ts +5 -0
  136. package/ts_build/src/clients/pricing/copilot.js +35 -0
  137. package/ts_build/src/clients/pricing/copilot.js.map +1 -0
  138. package/ts_build/src/clients/pricing/deepseek.d.ts +5 -0
  139. package/ts_build/src/clients/pricing/deepseek.js +10 -0
  140. package/ts_build/src/clients/pricing/deepseek.js.map +1 -0
  141. package/ts_build/src/clients/pricing/fireworks.d.ts +5 -0
  142. package/ts_build/src/clients/pricing/fireworks.js +21 -0
  143. package/ts_build/src/clients/pricing/fireworks.js.map +1 -0
  144. package/ts_build/src/clients/pricing/github.d.ts +4 -0
  145. package/ts_build/src/clients/pricing/github.js +58 -0
  146. package/ts_build/src/clients/pricing/github.js.map +1 -0
  147. package/ts_build/src/clients/pricing/google.d.ts +59 -6
  148. package/ts_build/src/clients/pricing/google.js +214 -167
  149. package/ts_build/src/clients/pricing/google.js.map +1 -1
  150. package/ts_build/src/clients/pricing/groq.d.ts +5 -0
  151. package/ts_build/src/clients/pricing/groq.js +41 -0
  152. package/ts_build/src/clients/pricing/groq.js.map +1 -0
  153. package/ts_build/src/clients/pricing/index.d.ts +16 -5
  154. package/ts_build/src/clients/pricing/index.js +62 -7
  155. package/ts_build/src/clients/pricing/index.js.map +1 -1
  156. package/ts_build/src/clients/pricing/llama.d.ts +4 -0
  157. package/ts_build/src/clients/pricing/llama.js +14 -0
  158. package/ts_build/src/clients/pricing/llama.js.map +1 -0
  159. package/ts_build/src/clients/pricing/mistral.d.ts +5 -0
  160. package/ts_build/src/clients/pricing/mistral.js +23 -0
  161. package/ts_build/src/clients/pricing/mistral.js.map +1 -0
  162. package/ts_build/src/clients/pricing/models.d.ts +5 -4
  163. package/ts_build/src/clients/pricing/models.js +8 -162
  164. package/ts_build/src/clients/pricing/models.js.map +1 -1
  165. package/ts_build/src/clients/pricing/nvidia.d.ts +8 -0
  166. package/ts_build/src/clients/pricing/nvidia.js +96 -0
  167. package/ts_build/src/clients/pricing/nvidia.js.map +1 -0
  168. package/ts_build/src/clients/pricing/openai.d.ts +86 -197
  169. package/ts_build/src/clients/pricing/openai.js +294 -168
  170. package/ts_build/src/clients/pricing/openai.js.map +1 -1
  171. package/ts_build/src/clients/pricing/openrouter.d.ts +4 -0
  172. package/ts_build/src/clients/pricing/openrouter.js +29 -0
  173. package/ts_build/src/clients/pricing/openrouter.js.map +1 -0
  174. package/ts_build/src/clients/pricing/types.d.ts +27 -2
  175. package/ts_build/src/clients/pricing/types.js +46 -0
  176. package/ts_build/src/clients/pricing/types.js.map +1 -1
  177. package/ts_build/src/clients/pricing/xai.d.ts +37 -57
  178. package/ts_build/src/clients/pricing/xai.js +92 -59
  179. package/ts_build/src/clients/pricing/xai.js.map +1 -1
  180. package/ts_build/src/clients/types.d.ts +1 -0
  181. package/ts_build/src/clients/xai.d.ts +2 -62
  182. package/ts_build/src/clients/xai.js +121 -0
  183. package/ts_build/src/clients/xai.js.map +1 -1
  184. package/ts_build/src/fileSync.js +7 -2
  185. package/ts_build/src/fileSync.js.map +1 -1
  186. package/ts_build/src/login.js +8 -2
  187. package/ts_build/src/login.js.map +1 -1
  188. package/ts_build/src/services/AgentSyncFs.js +1 -0
  189. package/ts_build/src/services/AgentSyncFs.js.map +1 -1
  190. package/ts_build/src/services/KnowhowClient.d.ts +1 -0
  191. package/ts_build/src/services/KnowhowClient.js +7 -0
  192. package/ts_build/src/services/KnowhowClient.js.map +1 -1
  193. package/ts_build/src/services/LazyToolsService.d.ts +1 -0
  194. package/ts_build/src/services/LazyToolsService.js +3 -0
  195. package/ts_build/src/services/LazyToolsService.js.map +1 -1
  196. package/ts_build/src/services/S3.js +0 -7
  197. package/ts_build/src/services/S3.js.map +1 -1
  198. package/ts_build/src/services/modules/index.js +41 -1
  199. package/ts_build/src/services/modules/index.js.map +1 -1
  200. package/ts_build/src/types.d.ts +163 -124
  201. package/ts_build/src/types.js +33 -213
  202. package/ts_build/src/types.js.map +1 -1
  203. package/ts_build/src/worker.d.ts +4 -0
  204. package/ts_build/src/worker.js +140 -0
  205. package/ts_build/src/worker.js.map +1 -1
  206. package/ts_build/tests/clients/pricing.test.js +21 -0
  207. package/ts_build/tests/clients/pricing.test.js.map +1 -1
  208. package/ts_build/tests/manual/clients/completions.test.js +27 -24
  209. package/ts_build/tests/manual/clients/completions.test.js.map +1 -1
@@ -1,80 +1,107 @@
1
- import { Models } from "../../types";
1
+ /**
2
+ * Anthropic model IDs, pricing, and catalog.
3
+ * Single source of truth for all Anthropic/Claude models.
4
+ * Deprecation dates from: https://docs.anthropic.com/en/docs/about-claude/model-deprecations
5
+ */
6
+ import { completions, ModelCatalogEntry, ModelPricing } from "./types";
2
7
 
3
- export const AnthropicTextPricing = {
4
- [Models.anthropic.Opus4_6]: {
5
- input: 5.0,
6
- cache_write: 6.25,
7
- cache_hit: 0.5,
8
- output: 25.0,
9
- },
10
- [Models.anthropic.Sonnet4_6]: {
11
- input: 3.0,
12
- cache_write: 3.75,
13
- cache_hit: 0.3,
14
- output: 15.0,
15
- },
16
- [Models.anthropic.Opus4_5]: {
17
- input: 5.0,
18
- cache_write: 6.25,
19
- cache_hit: 0.5,
20
- output: 25.0,
21
- },
22
- [Models.anthropic.Opus4_1]: {
23
- input: 15.0,
24
- cache_write: 18.75,
25
- cache_hit: 1.5,
26
- output: 75.0,
27
- },
28
- [Models.anthropic.Opus4]: {
29
- input: 15.0,
30
- cache_write: 18.75,
31
- cache_hit: 1.5,
32
- output: 75.0,
33
- },
34
- [Models.anthropic.Sonnet4]: {
35
- input: 3.0,
36
- input_gt_200k: 6.0,
37
- cache_write: 3.75,
38
- cache_hit: 0.3,
39
- output: 15.0,
40
- output_gt_200k: 22.5,
41
- },
42
- [Models.anthropic.Sonnet4_5]: {
43
- input: 3.0,
44
- input_gt_200k: 6.0,
45
- cache_write: 3.75,
46
- cache_hit: 0.3,
47
- output: 15.0,
48
- output_gt_200k: 22.5,
49
- },
50
- [Models.anthropic.Haiku4_5]: {
51
- input: 1,
52
- cache_write: 1.25,
53
- cache_hit: 0.1,
54
- output: 5,
55
- },
56
- [Models.anthropic.Sonnet3_7]: {
57
- input: 3.0,
58
- cache_write: 3.75,
59
- cache_hit: 0.3,
60
- output: 15.0,
61
- },
62
- [Models.anthropic.Sonnet3_5]: {
63
- input: 3.0,
64
- cache_write: 3.75,
65
- cache_hit: 0.3,
66
- output: 15.0,
67
- },
68
- [Models.anthropic.Opus3]: {
69
- input: 15.0,
70
- cache_write: 18.75,
71
- cache_hit: 1.5,
72
- output: 75.0,
73
- },
74
- [Models.anthropic.Haiku3]: {
75
- input: 0.25,
76
- cache_write: 0.3125,
77
- cache_hit: 0.025,
78
- output: 1.25,
79
- },
8
+ // ─── Model IDs ────────────────────────────────────────────────────────────────
9
+
10
+ export const AnthropicModels = {
11
+ // Active models
12
+ Opus4_7: "claude-opus-4-7",
13
+ Opus4_6: "claude-opus-4-6",
14
+ Opus4_6Fast: "claude-opus-4-6-fast",
15
+ Sonnet4_6: "claude-sonnet-4-6",
16
+ Opus4_5: "claude-opus-4-5-20251101",
17
+ Opus4_1: "claude-opus-4-1-20250805",
18
+ Sonnet4_5: "claude-sonnet-4-5-20250929",
19
+ Haiku4_5: "claude-haiku-4-5-20251001",
20
+ // Deprecated models (per Anthropic deprecation page)
21
+ Opus4: "claude-opus-4-20250514", // deprecated 2026-04-14, retirement 2026-06-15
22
+ Sonnet4: "claude-sonnet-4-20250514", // deprecated 2026-04-14, retirement 2026-06-15
23
+ Sonnet3_7: "claude-3-7-sonnet-20250219", // retired 2026-02-19
24
+ Sonnet3_5: "claude-3-5-sonnet-20241022", // retired 2025-10-28
25
+ Sonnet3_5_20240620: "claude-3-5-sonnet-20240620", // earlier version, retired
26
+ Haiku3_5_Latest: "claude-3-5-haiku-latest", // alias → claude-3-5-haiku-20241022, retired
27
+ Sonnet3: "claude-3-sonnet-20240229", // retired
28
+ // models.dev alias IDs (versioned as -0 suffix instead of date)
29
+ Opus4_0: "claude-opus-4-0", // alias for claude-opus-4-20250514, deprecated
30
+ Sonnet4_0: "claude-sonnet-4-0", // alias for claude-sonnet-4-20250514, deprecated
31
+ Haiku3_5: "claude-3-5-haiku-20241022", // retired 2026-02-19
32
+ Opus3: "claude-3-opus-20240229", // retired 2026-01-05
33
+ Haiku3: "claude-3-haiku-20240307", // retired 2026-04-20
34
+ } as const;
35
+
36
+ // ─── Active (non-deprecated) text models ──────────────────────────────────────
37
+
38
+ export const AnthropicTextModels: string[] = [
39
+ AnthropicModels.Opus4_7,
40
+ AnthropicModels.Opus4_6,
41
+ AnthropicModels.Sonnet4_6,
42
+ AnthropicModels.Opus4_5,
43
+ AnthropicModels.Opus4_1,
44
+ AnthropicModels.Sonnet4_5,
45
+ AnthropicModels.Haiku4_5,
46
+ ];
47
+
48
+ // Models in our catalog but not yet publicly available
49
+ export const AnthropicLimitedAvailabilityModels: string[] = [
50
+ AnthropicModels.Opus4_6Fast, // 404 – not publicly available yet
51
+ ];
52
+
53
+ // ─── All models for catalog (active + limited + deprecated/retired) ───────────
54
+ // Deprecation/replacement metadata is embedded in AnthropicTextPricing entries.
55
+ const AnthropicAllModels: string[] = [
56
+ ...AnthropicTextModels,
57
+ ...AnthropicLimitedAvailabilityModels,
58
+ // Deprecated (retirement 2026-06-15)
59
+ AnthropicModels.Opus4,
60
+ AnthropicModels.Sonnet4,
61
+ // Retired — kept for historical cost tracking
62
+ AnthropicModels.Sonnet3_7,
63
+ AnthropicModels.Sonnet3_5,
64
+ AnthropicModels.Sonnet3_5_20240620,
65
+ AnthropicModels.Haiku3_5_Latest,
66
+ AnthropicModels.Sonnet3,
67
+ AnthropicModels.Opus4_0,
68
+ AnthropicModels.Sonnet4_0,
69
+ AnthropicModels.Haiku3_5,
70
+ AnthropicModels.Opus3,
71
+ AnthropicModels.Haiku3,
72
+ ];
73
+
74
+ // ─── Pricing (USD per 1M tokens) ──────────────────────────────────────────────
75
+
76
+ export const AnthropicTextPricing: Record<string, ModelPricing> = {
77
+ [AnthropicModels.Opus4_7]: { input: 5.0, cache_write: 6.25, cache_hit: 0.5, output: 25.0 },
78
+ [AnthropicModels.Opus4_6]: { input: 5.0, cache_write: 6.25, cache_hit: 0.5, output: 25.0 },
79
+ [AnthropicModels.Opus4_6Fast]: { input: 30.0, cache_write: 37.5, cache_hit: 3.0, output: 150.0, limitedAvailability: true },
80
+ [AnthropicModels.Sonnet4_6]: { input: 3.0, cache_write: 3.75, cache_hit: 0.3, output: 15.0 },
81
+ [AnthropicModels.Opus4_5]: { input: 5.0, cache_write: 6.25, cache_hit: 0.5, output: 25.0 },
82
+ [AnthropicModels.Opus4_1]: { input: 15.0, cache_write: 18.75, cache_hit: 1.5, output: 75.0 },
83
+ [AnthropicModels.Sonnet4_5]: { input: 3.0, input_gt_200k: 6.0, cache_write: 3.75, cache_hit: 0.3, output: 15.0, output_gt_200k: 22.5 },
84
+ [AnthropicModels.Haiku4_5]: { input: 1.0, cache_write: 1.25, cache_hit: 0.1, output: 5.0 },
85
+ // Deprecated — pricing retained for cost tracking
86
+ [AnthropicModels.Opus4]: { input: 15.0, cache_write: 18.75, cache_hit: 1.5, output: 75.0, deprecated: true, deprecationDate: "2026-06-15" },
87
+ [AnthropicModels.Sonnet4]: { input: 3.0, input_gt_200k: 6.0, cache_write: 3.75, cache_hit: 0.3, output: 15.0, output_gt_200k: 22.5, deprecated: true, deprecationDate: "2026-06-15" },
88
+ // Retired — pricing retained for cost tracking of historical usage
89
+ [AnthropicModels.Sonnet3_7]: { input: 3.0, cache_write: 3.75, cache_hit: 0.3, output: 15.0, deprecated: true, deprecationDate: "2026-02-19" },
90
+ [AnthropicModels.Sonnet3_5]: { input: 3.0, cache_write: 3.75, cache_hit: 0.3, output: 15.0, deprecated: true, deprecationDate: "2025-10-28" },
91
+ [AnthropicModels.Sonnet3_5_20240620]: { input: 3.0, cache_write: 3.75, cache_hit: 0.3, output: 15.0, deprecated: true, deprecationDate: "2025-10-28" },
92
+ [AnthropicModels.Haiku3_5_Latest]: { input: 0.8, cache_write: 1.0, cache_hit: 0.08, output: 4.0, deprecated: true, deprecationDate: "2026-02-19" },
93
+ [AnthropicModels.Sonnet3]: { input: 3.0, cache_write: 3.75, cache_hit: 0.3, output: 15.0, deprecated: true },
94
+ [AnthropicModels.Opus4_0]: { input: 15.0, cache_write: 18.75, cache_hit: 1.5, output: 75.0, deprecated: true, deprecationDate: "2026-06-15" },
95
+ [AnthropicModels.Sonnet4_0]: { input: 3.0, cache_write: 3.75, cache_hit: 0.3, output: 15.0, deprecated: true, deprecationDate: "2026-06-15" },
96
+ [AnthropicModels.Haiku3_5]: { input: 0.8, cache_write: 1.0, cache_hit: 0.08, output: 4.0, deprecated: true, deprecationDate: "2026-02-19" },
97
+ [AnthropicModels.Opus3]: { input: 15.0, cache_write: 18.75, cache_hit: 1.5, output: 75.0, deprecated: true, deprecationDate: "2026-01-05" },
98
+ [AnthropicModels.Haiku3]: { input: 0.25, cache_write: 0.3125, cache_hit: 0.025, output: 1.25, deprecated: true, deprecationDate: "2026-04-20" },
80
99
  };
100
+
101
+ // ─── Catalog ──────────────────────────────────────────────────────────────────
102
+ // Metadata (deprecated, deprecationDate, limitedAvailability) is read directly
103
+ // from the AnthropicTextPricing entries — no need for separate groups.
104
+
105
+ export const ANTHROPIC_MODEL_CATALOG: ModelCatalogEntry[] = [
106
+ ...completions(AnthropicAllModels, "anthropic", AnthropicTextPricing),
107
+ ];
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Cerebras pricing (USD per 1M tokens)
3
+ * Source: https://cerebras.ai/pricing
4
+ */
5
+ export const CerebrasTextPricing: Record<string, { input: number; output: number }> = {
6
+ "llama3.1-8b": { input: 0.10, output: 0.10 },
7
+ "llama3.3-70b": { input: 0.85, output: 1.20 },
8
+ "qwen-3-235b-a22b-instruct-2507": { input: 0.60, output: 1.20 },
9
+ "gpt-oss-120b": { input: 0.25, output: 0.69 },
10
+ "zai-glm-4.7": { input: 2.25, output: 2.75 },
11
+ };
@@ -0,0 +1,60 @@
1
+ /**
2
+ * GitHub Copilot pricing — "premium request" multiplier system.
3
+ *
4
+ * GitHub Copilot does NOT charge per token. Instead each model call costs a
5
+ * certain number of "premium requests" from the subscriber's monthly allowance.
6
+ * All models are effectively $0/token from the perspective of knowhow pricing,
7
+ * but we store the multiplier as metadata for informational purposes.
8
+ *
9
+ * Copilot Individual: 300 premium requests/month
10
+ * Copilot Pro: 300 premium requests/month
11
+ * Copilot Business: 300 premium requests/month (per seat)
12
+ * Copilot Enterprise: 300 premium requests/month (per seat)
13
+ *
14
+ * Model IDs are as returned by https://api.githubcopilot.com/models
15
+ * Source: https://docs.github.com/en/copilot/reference/ai-models/supported-models
16
+ */
17
+
18
+ /** Copilot premium request multipliers (informational only) */
19
+ export const CopilotModelMultipliers: Record<string, number> = {
20
+ // OpenAI models
21
+ "gpt-4o": 0, // free (base request)
22
+ "gpt-4.1": 0, // free (base request)
23
+ "gpt-5-mini": 0, // free (base request)
24
+ "gpt-5.2": 1,
25
+ "gpt-5.2-codex": 1,
26
+ "gpt-5.3-codex": 1,
27
+ "gpt-5.4": 1,
28
+ "gpt-5.4-mini": 0.33,
29
+ "gpt-5.4-nano": 0.25,
30
+ "gpt-5.5": 7.5, // promotional until further notice
31
+ "gpt-5": 1,
32
+ "gpt-5.1": 1,
33
+ "gpt-5.1-codex": 1,
34
+ "gpt-5.1-codex-max": 1,
35
+ "gpt-5.1-codex-mini": 1,
36
+ // Anthropic models
37
+ "claude-haiku-4.5": 0.33,
38
+ "claude-sonnet-4": 1,
39
+ "claude-sonnet-4.5": 1,
40
+ "claude-sonnet-4.6": 1,
41
+ "claude-opus-4.5": 3,
42
+ "claude-opus-4.6": 3,
43
+ "claude-opus-41": 3,
44
+ "claude-opus-4.7": 7.5, // promotional until April 30, 2026
45
+ // Google models
46
+ "gemini-2.5-pro": 1,
47
+ "gemini-3-flash-preview": 0.33,
48
+ "gemini-3.1-pro-preview": 1,
49
+ "gemini-3-pro-preview": 1,
50
+ // xAI models
51
+ "grok-code-fast-1": 0.25,
52
+ };
53
+
54
+ /**
55
+ * Copilot pricing is all $0/token — consumption is via premium request allowance.
56
+ * This map is used by the check-model-pricing script to recognise registered models.
57
+ */
58
+ export const CopilotTextPricing: Record<string, { input: number; output: number }> = Object.fromEntries(
59
+ Object.keys(CopilotModelMultipliers).map((id) => [id, { input: 0.0, output: 0.0 }])
60
+ );
@@ -0,0 +1,15 @@
1
+ /**
2
+ * DeepSeek pricing (USD per 1M tokens)
3
+ * Source: https://platform.deepseek.com/pricing
4
+ */
5
+ export const DeepSeekTextPricing: Record<string, { input: number; output: number; cached_input?: number }> = {
6
+ // DeepSeek V3 / deepseek-chat — updated 2026-04 (now routes to DeepSeek V3-0324)
7
+ // Source: api-docs.deepseek.com/quick_start/pricing
8
+ "deepseek-chat": { input: 0.28, output: 0.42, cached_input: 0.028 },
9
+ // DeepSeek R1 / deepseek-reasoner — same unified pricing as V3
10
+ // Source: api-docs.deepseek.com/quick_start/pricing (costgoat.com verification)
11
+ "deepseek-reasoner": { input: 0.28, output: 0.42, cached_input: 0.028 },
12
+ // DeepSeek V4 Flash & Pro
13
+ "deepseek-v4-flash": { input: 0.14, output: 0.28 },
14
+ "deepseek-v4-pro": { input: 1.74, output: 3.48 },
15
+ };
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Fireworks AI pricing (USD per 1M tokens)
3
+ * Source: https://fireworks.ai/pricing
4
+ */
5
+ export const FireworksTextPricing: Record<string, { input: number; output: number; cache_hit?: number }> = {
6
+ // Moonshot AI
7
+ "accounts/fireworks/models/kimi-k2-6": { input: 0.95, cache_hit: 0.16, output: 4.0 },
8
+ "accounts/fireworks/models/kimi-k2-5": { input: 0.60, cache_hit: 0.10, output: 3.0 },
9
+
10
+ // MiniMax
11
+ "accounts/fireworks/models/minimax-m2-7": { input: 0.30, cache_hit: 0.06, output: 1.20 },
12
+ "accounts/fireworks/models/minimax-m2-5": { input: 0.30, cache_hit: 0.03, output: 1.20 },
13
+
14
+ // Qwen
15
+ "accounts/fireworks/models/qwen3-6-plus": { input: 0.50, cache_hit: 0.10, output: 3.0 },
16
+ "accounts/fireworks/models/qwen3p6-plus": { input: 0.50, cache_hit: 0.10, output: 3.0 },
17
+ "accounts/fireworks/models/qwen3-vl-30b-a3b-thinking": { input: 0.15, cache_hit: 0.08, output: 0.60 },
18
+ "accounts/fireworks/models/qwen3-vl-30b-a3b-instruct": { input: 0.15, cache_hit: 0.08, output: 0.60 },
19
+ "accounts/fireworks/models/qwen3-8b": { input: 0.20, cache_hit: 0.10, output: 0.20 },
20
+
21
+ // Z.ai
22
+ "accounts/fireworks/models/glm-5-1": { input: 1.40, cache_hit: 0.26, output: 4.40 },
23
+ "accounts/fireworks/models/glm-5": { input: 1.00, cache_hit: 0.20, output: 3.20 },
24
+ "accounts/fireworks/models/glm-4-7": { input: 0.60, cache_hit: 0.30, output: 2.20 },
25
+
26
+ // DeepSeek AI
27
+ "accounts/fireworks/models/deepseek-v3-2": { input: 0.56, cache_hit: 0.28, output: 1.68 },
28
+ "accounts/fireworks/models/deepseek-v3-1": { input: 0.56, cache_hit: 0.28, output: 1.68 },
29
+
30
+ // OpenAI OSS
31
+ "accounts/fireworks/models/gpt-oss-120b": { input: 0.15, cache_hit: 0.01, output: 0.60 },
32
+ };
@@ -0,0 +1,69 @@
1
+ /**
2
+ * GitHub Models pricing (USD per 1M tokens)
3
+ * Source: https://github.com/marketplace/models
4
+ * All models are free within rate limits for GitHub users.
5
+ * Low-tier (higher rate limits) and high-tier (lower rate limits) exist.
6
+ */
7
+ export const GitHubModelsTextPricing: Record<string, { input: number; output: number }> = {
8
+ // OpenAI via GitHub (free)
9
+ "openai/gpt-4o": { input: 0.0, output: 0.0 },
10
+ "openai/gpt-4o-mini": { input: 0.0, output: 0.0 },
11
+ "openai/o1": { input: 0.0, output: 0.0 },
12
+ "openai/o1-mini": { input: 0.0, output: 0.0 },
13
+ "openai/o3-mini": { input: 0.0, output: 0.0 },
14
+ "openai/o4-mini": { input: 0.0, output: 0.0 },
15
+ "openai/gpt-4.1": { input: 0.0, output: 0.0 },
16
+ "openai/gpt-4.1-mini": { input: 0.0, output: 0.0 },
17
+ "openai/gpt-4.1-nano": { input: 0.0, output: 0.0 },
18
+ "openai/o3": { input: 0.0, output: 0.0 },
19
+ // DeepSeek via GitHub (free)
20
+ "deepseek/deepseek-r1": { input: 0.0, output: 0.0 },
21
+ "deepseek/deepseek-v3-0324": { input: 0.0, output: 0.0 },
22
+ // Microsoft Phi via GitHub (free)
23
+ "microsoft/phi-4": { input: 0.0, output: 0.0 },
24
+ "microsoft/phi-4-mini-instruct": { input: 0.0, output: 0.0 },
25
+ "microsoft/phi-4-multimodal-instruct": { input: 0.0, output: 0.0 },
26
+ "microsoft/phi-4-mini-reasoning": { input: 0.0, output: 0.0 },
27
+ "microsoft/phi-4-reasoning": { input: 0.0, output: 0.0 },
28
+ "microsoft/phi-3-medium-128k-instruct": { input: 0.0, output: 0.0 },
29
+ "microsoft/phi-3-medium-4k-instruct": { input: 0.0, output: 0.0 },
30
+ "microsoft/phi-3-mini-128k-instruct": { input: 0.0, output: 0.0 },
31
+ "microsoft/phi-3-mini-4k-instruct": { input: 0.0, output: 0.0 },
32
+ "microsoft/phi-3-small-128k-instruct": { input: 0.0, output: 0.0 },
33
+ "microsoft/phi-3-small-8k-instruct": { input: 0.0, output: 0.0 },
34
+ "microsoft/phi-3.5-mini-instruct": { input: 0.0, output: 0.0 },
35
+ "microsoft/phi-3.5-moe-instruct": { input: 0.0, output: 0.0 },
36
+ "microsoft/phi-3.5-vision-instruct": { input: 0.0, output: 0.0 },
37
+ "microsoft/mai-ds-r1": { input: 0.0, output: 0.0 },
38
+ // Meta Llama via GitHub (free)
39
+ "meta/llama-3.3-70b-instruct": { input: 0.0, output: 0.0 },
40
+ "meta/llama-3.2-11b-vision-instruct": { input: 0.0, output: 0.0 },
41
+ "meta/llama-3.1-405b-instruct": { input: 0.0, output: 0.0 },
42
+ "meta/llama-3.2-90b-vision-instruct": { input: 0.0, output: 0.0 },
43
+ "meta/llama-4-maverick-17b-128e-instruct-fp8": { input: 0.0, output: 0.0 },
44
+ "meta/llama-4-scout-17b-16e-instruct": { input: 0.0, output: 0.0 },
45
+ "meta/meta-llama-3-70b-instruct": { input: 0.0, output: 0.0 },
46
+ "meta/meta-llama-3-8b-instruct": { input: 0.0, output: 0.0 },
47
+ "meta/meta-llama-3.1-405b-instruct": { input: 0.0, output: 0.0 },
48
+ "meta/meta-llama-3.1-70b-instruct": { input: 0.0, output: 0.0 },
49
+ "meta/meta-llama-3.1-8b-instruct": { input: 0.0, output: 0.0 },
50
+ // Mistral via GitHub (free)
51
+ "mistral-ai/mistral-large-2411": { input: 0.0, output: 0.0 },
52
+ "mistral-ai/mistral-small-2503": { input: 0.0, output: 0.0 },
53
+ "mistral-ai/codestral-2501": { input: 0.0, output: 0.0 },
54
+ "mistral-ai/ministral-3b": { input: 0.0, output: 0.0 },
55
+ "mistral-ai/mistral-medium-2505": { input: 0.0, output: 0.0 },
56
+ "mistral-ai/mistral-nemo": { input: 0.0, output: 0.0 },
57
+ // Cohere via GitHub (free)
58
+ "cohere/cohere-command-r-plus-08-2024": { input: 0.0, output: 0.0 },
59
+ "cohere/cohere-command-r-08-2024": { input: 0.0, output: 0.0 },
60
+ "cohere/cohere-command-a": { input: 0.0, output: 0.0 },
61
+ // AI21 via GitHub (free)
62
+ "ai21-labs/ai21-jamba-1.5-mini": { input: 0.0, output: 0.0 },
63
+ "ai21-labs/ai21-jamba-1.5-large": { input: 0.0, output: 0.0 },
64
+ // Core42
65
+ "core42/jais-30b-chat": { input: 0.0, output: 0.0 },
66
+ // xAI via GitHub (free)
67
+ "xai/grok-3": { input: 0.0, output: 0.0 },
68
+ "xai/grok-3-mini": { input: 0.0, output: 0.0 },
69
+ };