@goliapkg/tiktoken-wasm 4.0.1 → 4.1.2

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/README.md CHANGED
@@ -173,19 +173,23 @@ Map a model name to its encoding name without loading the encoding.
173
173
 
174
174
  ### `estimateCost(modelId, inputTokens, outputTokens): number`
175
175
 
176
- Estimate API cost in USD. Supports 107 models across 10 providers.
176
+ Estimate API cost in USD. Supports 116 models across 11 providers.
177
177
 
178
178
  ### `getModelInfo(modelId): ModelInfo`
179
179
 
180
180
  Get model metadata with full TypeScript typing.
181
181
 
182
+ The id is resolved the way `estimateCost` resolves it, so a model addressed as
183
+ its API spells it (`claude-haiku-4-5`, `anthropic.claude-opus-5`) returns that
184
+ model. The returned `id` is this table's own spelling.
185
+
182
186
  ### `allModels(): ModelInfo[]`
183
187
 
184
- List all 107 supported models with pricing info.
188
+ List all 116 supported models with pricing info.
185
189
 
186
190
  ### `modelsByProvider(provider): ModelInfo[]`
187
191
 
188
- Filter models by provider: `"OpenAI"`, `"Anthropic"`, `"Google"`, `"Meta"`, `"DeepSeek"`, `"Alibaba"`, `"Mistral"`.
192
+ Filter models by provider: `"OpenAI"`, `"Anthropic"`, `"Google"`, `"Meta"`, `"DeepSeek"`, `"Alibaba"`, `"Mistral"`, `"Moonshot"`, `"Zhipu"`, `"MiniMax"`, `"Voyage"`.
189
193
 
190
194
  ### `ModelInfo`
191
195
 
@@ -201,14 +205,14 @@ Filter models by provider: `"OpenAI"`, `"Anthropic"`, `"Google"`, `"Meta"`, `"De
201
205
 
202
206
  ## Supported Models (pricing)
203
207
 
204
- `estimateCost` / `getModelInfo` / `allModels` cover **107 models across 10
208
+ `estimateCost` / `getModelInfo` / `allModels` cover **116 models across 11
205
209
  providers** (2026-08 pricing). Per provider, newest first:
206
210
 
207
211
  | Provider | Models | Latest entries |
208
212
  |----------|-------:|----------------|
209
213
  | OpenAI | 34 | gpt-5.6-sol/terra/luna, gpt-5.5(-pro), gpt-5.4(-mini/nano/pro), gpt-5.2(-pro), gpt-5.1, gpt-5(-mini/nano/pro), gpt-4.1, gpt-4o, o1/o3/o4-mini, … |
210
214
  | Anthropic | 17 | claude-fable-5, claude-mythos-5, claude-opus-5, claude-sonnet-5, claude-opus-4.8/4.7/4.6, claude-haiku-4.5, … |
211
- | Google | 12 | gemini-3.1-pro-preview, gemini-3.6/3.5-flash, gemini-2.5-pro/flash, … |
215
+ | Google | 13 | gemini-3.1-pro-preview, gemini-3.6/3.5-flash, gemini-2.5-pro/flash, … |
212
216
  | Mistral | 12 | mistral-large/medium/small, codestral, devstral, ministral, pixtral-large, … |
213
217
  | Alibaba | 9 | qwen3.8-max, qwen3.5-plus, qwen3-max/plus/coder, qwen2.5-72b, … |
214
218
  | Meta | 6 | llama-4-scout/maverick, llama-3.3-70b, llama-3.1-405b/70b/8b |
@@ -216,6 +220,7 @@ providers** (2026-08 pricing). Per provider, newest first:
216
220
  | DeepSeek | 4 | deepseek-v4-pro, deepseek-v4-flash, deepseek-v3, deepseek-r1 |
217
221
  | MiniMax | 4 | minimax-m2.7, minimax-m2.5, minimax-m2.1, minimax-m2 |
218
222
  | Moonshot | 4 | kimi-k3, kimi-k2.7-code, kimi-k2.6, kimi-k2.5 |
223
+ | Voyage | 8 | voyage-4-large/4/4-lite/code-4, voyage-3-large, voyage-3.5(-lite), voyage-code-3 (embeddings) |
219
224
 
220
225
  The authoritative list is the code: call `allModels()` at runtime, or see
221
226
  [docs.rs](https://docs.rs/tiktoken/latest/tiktoken/pricing/index.html).
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@goliapkg/tiktoken-wasm",
3
3
  "type": "module",
4
4
  "description": "WASM bindings for the tiktoken BPE tokenizer",
5
- "version": "4.0.1",
5
+ "version": "4.1.2",
6
6
  "license": "MIT OR Apache-2.0",
7
7
  "repository": {
8
8
  "type": "git",
@@ -124,6 +124,11 @@ export function getEncoding(name: string): Encoding;
124
124
  * Returns a typed object with: `id`, `provider`, `inputPer1m`, `outputPer1m`,
125
125
  * `cachedInputPer1m`, `contextWindow`, `maxOutput`.
126
126
  *
127
+ * The id is resolved the same way `estimateCost` resolves it, so a model
128
+ * addressed the way its API spells it (`claude-haiku-4-5`,
129
+ * `anthropic.claude-opus-5`) returns that model's entry. The returned `id` is
130
+ * the table's own spelling.
131
+ *
127
132
  * Throws `Error` for unknown model ids.
128
133
  */
129
134
  export function getModelInfo(model_id: string): ModelInfo;
@@ -145,7 +150,8 @@ export function modelToEncoding(model: string): string | undefined;
145
150
  /**
146
151
  * List models filtered by provider name.
147
152
  *
148
- * Provider names: `"OpenAI"`, `"Anthropic"`, `"Google"`, `"Meta"`, `"DeepSeek"`, `"Alibaba"`, `"Mistral"`.
153
+ * Provider names: `"OpenAI"`, `"Anthropic"`, `"Google"`, `"Meta"`, `"DeepSeek"`,
154
+ * `"Alibaba"`, `"Mistral"`, `"Moonshot"`, `"Zhipu"`, `"MiniMax"`, `"Voyage"`.
149
155
  * Returns an empty array for unknown providers.
150
156
  */
151
157
  export function modelsByProvider(provider: string): ModelInfo[];
package/tiktoken_wasm.js CHANGED
@@ -382,6 +382,11 @@ export function getEncoding(name) {
382
382
  * Returns a typed object with: `id`, `provider`, `inputPer1m`, `outputPer1m`,
383
383
  * `cachedInputPer1m`, `contextWindow`, `maxOutput`.
384
384
  *
385
+ * The id is resolved the same way `estimateCost` resolves it, so a model
386
+ * addressed the way its API spells it (`claude-haiku-4-5`,
387
+ * `anthropic.claude-opus-5`) returns that model's entry. The returned `id` is
388
+ * the table's own spelling.
389
+ *
385
390
  * Throws `Error` for unknown model ids.
386
391
  * @param {string} model_id
387
392
  * @returns {ModelInfo}
@@ -453,7 +458,8 @@ export function modelToEncoding(model) {
453
458
  /**
454
459
  * List models filtered by provider name.
455
460
  *
456
- * Provider names: `"OpenAI"`, `"Anthropic"`, `"Google"`, `"Meta"`, `"DeepSeek"`, `"Alibaba"`, `"Mistral"`.
461
+ * Provider names: `"OpenAI"`, `"Anthropic"`, `"Google"`, `"Meta"`, `"DeepSeek"`,
462
+ * `"Alibaba"`, `"Mistral"`, `"Moonshot"`, `"Zhipu"`, `"MiniMax"`, `"Voyage"`.
457
463
  * Returns an empty array for unknown providers.
458
464
  * @param {string} provider
459
465
  * @returns {ModelInfo[]}
Binary file