@crossworks/voice-client 0.234.10 → 0.234.14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crossworks/voice-client",
3
- "version": "0.234.10",
3
+ "version": "0.234.14",
4
4
  "description": "Browser-safe surface of the voice/model layer — provider catalogue, model catalogs, audio tags, and the adapter type/metadata contract. Zero deps by design: nothing here may reach the network adapters or node builtins (the jackdaw-repo-split P0 boundary).",
5
5
  "exports": {
6
6
  ".": "./src/index.ts",
@@ -56,6 +56,7 @@ export const WIRED_PROVIDERS: Record<WiredCapability, ReadonlySet<ProviderId>> =
56
56
  'xai',
57
57
  'huggingface',
58
58
  'deepseek',
59
+ 'mammouth',
59
60
  'copilot',
60
61
  'custom',
61
62
  'local',
@@ -0,0 +1,312 @@
1
+ /**
2
+ * Mammouth static catalog.
3
+ *
4
+ * Mammouth (https://mammouth.ai) is an OpenRouter-style aggregator: one key,
5
+ * many vendors' models, behind an OpenAI-compatible API at
6
+ * `https://api.mammouth.ai/v1` (`/chat/completions`, `/models`, `/embeddings`).
7
+ * Auth is `Authorization: Bearer <key>`. Reference:
8
+ * https://info.mammouth.ai/docs/api-quick-start/.
9
+ *
10
+ * Model ids are BARE (`gpt-5.4`, `claude-haiku-4-5`), not OpenRouter's
11
+ * `vendor/model` slugs, so they can't share rows in the fallback price table
12
+ * (`packages/tracing/src/pricing.ts`): a bare `claude-haiku-4-5` row would
13
+ * also price the direct-Anthropic route. The adapter prices calls from THIS
14
+ * list instead (see `mammouthCostUsd`).
15
+ *
16
+ * Prices are Mammouth's published per-1M rates (2026-10-03). Mammouth states
17
+ * they are upper bounds: the real charge can be lower. Context windows are not
18
+ * published, so `contextTokens` is left out rather than guessed.
19
+ *
20
+ * Not listed: `gemini-3.1-flash-image-preview` (image output, priced per
21
+ * image) and the two `text-embedding-3-*` models (Mantle's embedder is one
22
+ * brain-wide config; see docs/embeddings.md).
23
+ *
24
+ * Maintenance: Mammouth adds models often. Live discovery returns uncatalogued
25
+ * ids too, and `pnpm -C server/web models:drift` reports them; add a row here
26
+ * when one should carry a price and a description.
27
+ */
28
+
29
+ import type { ChatModelInfo } from '../adapters/types';
30
+
31
+ export const MAMMOUTH_BASE_URL = 'https://api.mammouth.ai/v1';
32
+
33
+ /** The default pick: Mammouth's own router, which points at its current
34
+ * best-value model and is billed at that model's price. */
35
+ export const MAMMOUTH_DEFAULT_CHAT_MODEL = 'mammouth-recommended';
36
+
37
+ const TOOLS = ['function_calling'] as const;
38
+ const TOOLS_VISION = ['function_calling', 'vision'] as const;
39
+ const TOOLS_VISION_REASONING = ['function_calling', 'vision', 'reasoning'] as const;
40
+
41
+ export const MAMMOUTH_CHAT_MODELS: readonly ChatModelInfo[] = [
42
+ {
43
+ id: 'mammouth-recommended',
44
+ label: 'Mammouth Recommended',
45
+ description:
46
+ 'Mammouth picks the current best-value model (glm-5.3-flash, minimax-m3 fallback) and bills at its price. Cost is not tracked for this id because the price moves with the pick.',
47
+ capabilities: TOOLS,
48
+ },
49
+ // ── Anthropic ────────────────────────────────────────────────────
50
+ {
51
+ id: 'claude-fable-5.1',
52
+ label: 'Claude Fable 5.1',
53
+ description: 'Anthropic top tier.',
54
+ capabilities: TOOLS_VISION_REASONING,
55
+ inputPricePer1M: 10,
56
+ outputPricePer1M: 50,
57
+ },
58
+ {
59
+ id: 'claude-opus-5-5',
60
+ label: 'Claude Opus 5.5',
61
+ description: 'Anthropic flagship.',
62
+ capabilities: TOOLS_VISION_REASONING,
63
+ inputPricePer1M: 4,
64
+ outputPricePer1M: 20,
65
+ },
66
+ {
67
+ id: 'claude-sonnet-5',
68
+ label: 'Claude Sonnet 5',
69
+ description: 'Anthropic balanced.',
70
+ capabilities: TOOLS_VISION_REASONING,
71
+ inputPricePer1M: 2,
72
+ outputPricePer1M: 10,
73
+ },
74
+ {
75
+ id: 'claude-haiku-4-5',
76
+ label: 'Claude Haiku 4.5',
77
+ description: 'Anthropic fast and cheap.',
78
+ capabilities: TOOLS_VISION,
79
+ inputPricePer1M: 1,
80
+ outputPricePer1M: 5,
81
+ },
82
+ // ── OpenAI ───────────────────────────────────────────────────────
83
+ {
84
+ id: 'gpt-6-astra',
85
+ label: 'GPT-6 Astra',
86
+ description: 'OpenAI top tier.',
87
+ capabilities: TOOLS_VISION_REASONING,
88
+ inputPricePer1M: 10,
89
+ outputPricePer1M: 50,
90
+ },
91
+ {
92
+ id: 'gpt-6-sol',
93
+ label: 'GPT-6 Sol',
94
+ description: 'OpenAI balanced.',
95
+ capabilities: TOOLS_VISION_REASONING,
96
+ inputPricePer1M: 2,
97
+ outputPricePer1M: 10,
98
+ },
99
+ {
100
+ id: 'gpt-6-luna',
101
+ label: 'GPT-6 Luna',
102
+ description: 'OpenAI small and cheap.',
103
+ capabilities: TOOLS_VISION,
104
+ inputPricePer1M: 0.1,
105
+ outputPricePer1M: 0.5,
106
+ },
107
+ {
108
+ id: 'gpt-5.5',
109
+ label: 'GPT-5.5',
110
+ description: 'OpenAI previous flagship.',
111
+ capabilities: TOOLS_VISION_REASONING,
112
+ inputPricePer1M: 5,
113
+ outputPricePer1M: 30,
114
+ },
115
+ {
116
+ id: 'gpt-5.4',
117
+ label: 'GPT-5.4',
118
+ description: 'OpenAI.',
119
+ capabilities: TOOLS_VISION_REASONING,
120
+ inputPricePer1M: 2.5,
121
+ outputPricePer1M: 15,
122
+ },
123
+ {
124
+ id: 'gpt-5.4-mini',
125
+ label: 'GPT-5.4 Mini',
126
+ description: 'OpenAI small.',
127
+ capabilities: TOOLS_VISION,
128
+ inputPricePer1M: 0.75,
129
+ outputPricePer1M: 4.5,
130
+ },
131
+ {
132
+ id: 'gpt-5.4-nano',
133
+ label: 'GPT-5.4 Nano',
134
+ description: 'OpenAI smallest.',
135
+ capabilities: TOOLS_VISION,
136
+ inputPricePer1M: 0.2,
137
+ outputPricePer1M: 1.25,
138
+ },
139
+ // ── Google ───────────────────────────────────────────────────────
140
+ {
141
+ id: 'gemini-3.1-pro-preview',
142
+ label: 'Gemini 3.1 Pro (preview)',
143
+ description: 'Google flagship.',
144
+ capabilities: TOOLS_VISION_REASONING,
145
+ inputPricePer1M: 2,
146
+ outputPricePer1M: 12,
147
+ },
148
+ {
149
+ id: 'gemini-3.8-flash',
150
+ label: 'Gemini 3.8 Flash',
151
+ description: 'Google fast.',
152
+ capabilities: TOOLS_VISION,
153
+ inputPricePer1M: 0.75,
154
+ outputPricePer1M: 3.75,
155
+ },
156
+ {
157
+ id: 'gemini-3.7-flash',
158
+ label: 'Gemini 3.7 Flash',
159
+ description: 'Google fast (previous).',
160
+ capabilities: TOOLS_VISION,
161
+ inputPricePer1M: 1.5,
162
+ outputPricePer1M: 7.5,
163
+ },
164
+ // ── xAI ──────────────────────────────────────────────────────────
165
+ {
166
+ id: 'grok-4.7',
167
+ label: 'Grok 4.7',
168
+ description: 'xAI flagship.',
169
+ capabilities: TOOLS_VISION_REASONING,
170
+ inputPricePer1M: 2,
171
+ outputPricePer1M: 6,
172
+ },
173
+ // ── Open-weight and other vendors ────────────────────────────────
174
+ {
175
+ id: 'deepseek-v4-pro',
176
+ label: 'DeepSeek V4 Pro',
177
+ description: 'DeepSeek flagship.',
178
+ capabilities: ['function_calling', 'reasoning'],
179
+ inputPricePer1M: 1.74,
180
+ outputPricePer1M: 3.48,
181
+ },
182
+ {
183
+ id: 'deepseek-v4.1-flash',
184
+ label: 'DeepSeek V4.1 Flash',
185
+ description: 'DeepSeek fast and cheap.',
186
+ capabilities: TOOLS,
187
+ inputPricePer1M: 0.22,
188
+ outputPricePer1M: 0.66,
189
+ },
190
+ {
191
+ id: 'glm-5.3',
192
+ label: 'GLM 5.3',
193
+ description: 'Z.ai flagship.',
194
+ capabilities: TOOLS,
195
+ inputPricePer1M: 1.4,
196
+ outputPricePer1M: 4.4,
197
+ },
198
+ {
199
+ id: 'glm-5.3-flash',
200
+ label: 'GLM 5.3 Flash',
201
+ description: 'Z.ai fast. The current target of mammouth-recommended.',
202
+ capabilities: TOOLS,
203
+ inputPricePer1M: 0.15,
204
+ outputPricePer1M: 0.5,
205
+ },
206
+ {
207
+ id: 'kimi-k3',
208
+ label: 'Kimi K3',
209
+ description: 'Moonshot flagship.',
210
+ capabilities: TOOLS,
211
+ inputPricePer1M: 3,
212
+ outputPricePer1M: 15,
213
+ },
214
+ {
215
+ id: 'kimi-k2.6',
216
+ label: 'Kimi K2.6',
217
+ description: 'Moonshot.',
218
+ capabilities: TOOLS,
219
+ inputPricePer1M: 0.73,
220
+ outputPricePer1M: 3.49,
221
+ },
222
+ {
223
+ id: 'minimax-m3',
224
+ label: 'MiniMax M3',
225
+ description: 'MiniMax.',
226
+ capabilities: TOOLS,
227
+ inputPricePer1M: 0.3,
228
+ outputPricePer1M: 1.2,
229
+ },
230
+ {
231
+ id: 'qwen3.7-plus',
232
+ label: 'Qwen 3.7 Plus',
233
+ description: 'Alibaba Qwen.',
234
+ capabilities: TOOLS,
235
+ inputPricePer1M: 0.4,
236
+ outputPricePer1M: 1.6,
237
+ },
238
+ {
239
+ id: 'qwen3.8-27b',
240
+ label: 'Qwen 3.8 27B',
241
+ description: 'Alibaba Qwen, open weights.',
242
+ capabilities: TOOLS,
243
+ inputPricePer1M: 0.4,
244
+ outputPricePer1M: 2.55,
245
+ },
246
+ {
247
+ id: 'qwen3.8-flash',
248
+ label: 'Qwen 3.8 Flash',
249
+ description: 'Alibaba Qwen, fast.',
250
+ capabilities: TOOLS,
251
+ inputPricePer1M: 0.15,
252
+ outputPricePer1M: 0.47,
253
+ },
254
+ {
255
+ id: 'mistral-medium-3-5',
256
+ label: 'Mistral Medium 3.5',
257
+ description: 'Mistral.',
258
+ capabilities: TOOLS,
259
+ inputPricePer1M: 1.5,
260
+ outputPricePer1M: 7.5,
261
+ },
262
+ {
263
+ id: 'mistral-small-3.2-24b-instruct',
264
+ label: 'Mistral Small 3.2 24B',
265
+ description: 'Mistral small, open weights.',
266
+ capabilities: TOOLS,
267
+ inputPricePer1M: 0.1,
268
+ outputPricePer1M: 0.3,
269
+ },
270
+ {
271
+ id: 'llama-4-maverick',
272
+ label: 'Llama 4 Maverick',
273
+ description: 'Meta, open weights.',
274
+ capabilities: TOOLS,
275
+ inputPricePer1M: 0.15,
276
+ outputPricePer1M: 0.6,
277
+ },
278
+ // ── Perplexity (web-grounded) ────────────────────────────────────
279
+ {
280
+ id: 'sonar-pro',
281
+ label: 'Sonar Pro',
282
+ description:
283
+ 'Perplexity web-grounded answers. Token price only; any per-search fee is not tracked.',
284
+ inputPricePer1M: 3,
285
+ outputPricePer1M: 15,
286
+ },
287
+ {
288
+ id: 'sonar-deep-research',
289
+ label: 'Sonar Deep Research',
290
+ description: 'Perplexity multi-step web research. Slow. Token price only.',
291
+ inputPricePer1M: 2,
292
+ outputPricePer1M: 8,
293
+ },
294
+ ];
295
+
296
+ /**
297
+ * Cost of one Mammouth call in USD, from the catalog's published rate. Returns
298
+ * undefined for an uncatalogued id or `mammouth-recommended` (no fixed price),
299
+ * so the trace falls back to its own table rather than recording a wrong
300
+ * number. Cached input tokens are priced at the full input rate: Mammouth
301
+ * publishes no cache rate, and its listed prices are already upper bounds.
302
+ */
303
+ export function mammouthCostUsd(
304
+ model: string,
305
+ tokensIn: number | undefined,
306
+ tokensOut: number | undefined,
307
+ ): number | undefined {
308
+ const m = MAMMOUTH_CHAT_MODELS.find((x) => x.id === model.toLowerCase());
309
+ if (!m || m.inputPricePer1M == null || m.outputPricePer1M == null) return undefined;
310
+ if (tokensIn == null && tokensOut == null) return undefined;
311
+ return ((tokensIn ?? 0) * m.inputPricePer1M + (tokensOut ?? 0) * m.outputPricePer1M) / 1_000_000;
312
+ }
package/src/index.ts CHANGED
@@ -33,6 +33,7 @@ export * from './catalogs/elevenlabs';
33
33
  export * from './catalogs/deepgram';
34
34
  export * from './catalogs/assemblyai';
35
35
  export * from './catalogs/deepseek';
36
+ export * from './catalogs/mammouth';
36
37
 
37
38
  // Pure wiring metadata (no adapter modules pulled — registry.ts only imports
38
39
  // the retry helper, which is itself dependency-free).
package/src/providers.ts CHANGED
@@ -33,6 +33,7 @@ export type ProviderId =
33
33
  | 'xai'
34
34
  | 'huggingface'
35
35
  | 'deepseek'
36
+ | 'mammouth'
36
37
  | 'copilot'
37
38
  | 'mistral'
38
39
  | 'cohere'
@@ -151,6 +152,16 @@ export const SUPPORTED_PROVIDERS: readonly Provider[] = [
151
152
  signupUrl: 'https://platform.deepseek.com',
152
153
  docsUrl: 'https://api-docs.deepseek.com',
153
154
  },
155
+ {
156
+ id: 'mammouth',
157
+ label: 'Mammouth',
158
+ description:
159
+ 'Aggregator like OpenRouter: Claude, GPT, Gemini, Grok, DeepSeek, GLM, Kimi, Qwen, Mistral, and more behind one key, through an OpenAI-compatible API. Chat only in Mantle; keep OpenRouter (or another provider) for voice, images, and vision.',
160
+ capabilities: ['chat'],
161
+ signupUrl: 'https://mammouth.ai/app/account/settings/api',
162
+ docsUrl: 'https://info.mammouth.ai/docs/api-quick-start/',
163
+ isAggregator: true,
164
+ },
154
165
  {
155
166
  id: 'copilot',
156
167
  label: 'GitHub Copilot',