smoltalk 0.12.0 → 0.13.0

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
@@ -197,8 +197,8 @@ Two provider notes:
197
197
  | `model` | `ModelName` | **Required.** The model to use (e.g. `"gpt-4o"`, `"gemini-2.0-flash-lite"`). |
198
198
  | `messages` | `Message[]` | **Required.** The conversation messages to send. |
199
199
  | `apiKey` | `{ openAi?, google?, anthropic?, ollama?, openRouter?, deepInfra?, liteLlm?, openAiCompat? }` | API keys, nested by provider. Each falls back to its conventional env var (`OPENAI_API_KEY`, `GEMINI_API_KEY`, `ANTHROPIC_API_KEY`, `OPENROUTER_API_KEY`, `DEEPINFRA_API_KEY`, `LITELLM_API_KEY`, `OPENAI_COMPAT_API_KEY`). Ollama has no env-var fallback for the key. |
200
- | `baseUrl` | `{ ollama?, openRouter?, deepInfra?, liteLlm?, openAiCompat? }` | Custom base URLs. `ollama` defaults to `$OLLAMA_HOST` then `http://localhost:11434`; `openRouter`/`deepInfra` defaults are baked in; `liteLlm`/`openAiCompat` require an explicit URL (or `LITELLM_BASE_URL` / `OPENAI_COMPAT_BASE_URL` env). |
201
- | `provider` | `Provider` | Override provider detection. One of `"openai"`, `"openai-responses"`, `"google"`, `"ollama"`, `"anthropic"`, `"openrouter"`, `"deepinfra"`, `"litellm"`, `"openai-compat"`, or any provider registered via `registerProvider()`. |
200
+ | `baseUrl` | `{ ollama?, openRouter?, deepInfra?, liteLlm?, openAiCompat?, mlx? }` | Custom base URLs. `ollama` defaults to `$OLLAMA_HOST` then `http://localhost:11434`; `openRouter`/`deepInfra` defaults are baked in; `mlx` defaults to `$MLX_BASE_URL` then `http://127.0.0.1:8080/v1`; `liteLlm`/`openAiCompat` require an explicit URL (or `LITELLM_BASE_URL` / `OPENAI_COMPAT_BASE_URL` env). |
201
+ | `provider` | `Provider` | Override provider detection. One of `"openai"`, `"openai-responses"`, `"google"`, `"ollama"`, `"anthropic"`, `"openrouter"`, `"deepinfra"`, `"litellm"`, `"openai-compat"`, `"mlx"`, or any provider registered via `registerProvider()`. |
202
202
  | `logLevel` | `LogLevel` | Logging verbosity: `"debug"`, `"info"`, `"warn"`, `"error"`. |
203
203
  | `tools` | `{ name, description?, schema }[]` | Tool definitions. `schema` is a Zod object schema. |
204
204
  | `responseFormat` | `ZodType` | Zod schema for structured output. The response is parsed and validated against this schema. |
@@ -254,6 +254,7 @@ model ids aren't in the smoltalk registry.
254
254
  | `"deepinfra"` | DeepInfra hosted models | `apiKey.deepInfra` (or `DEEPINFRA_API_KEY`) | `usage.estimated_cost` |
255
255
  | `"litellm"` | Your own LiteLLM proxy | `apiKey.liteLlm` + `baseUrl.liteLlm` (or `LITELLM_API_KEY` / `LITELLM_BASE_URL`) | `x-litellm-response-cost` header (non-stream only) |
256
256
  | `"openai-compat"` | Any OpenAI-shape backend (vLLM, TGI, LM Studio…) | `apiKey.openAiCompat` + `baseUrl.openAiCompat` (or `OPENAI_COMPAT_API_KEY` / `OPENAI_COMPAT_BASE_URL`) | Best-effort: reads `usage.cost`/`estimated_cost`/`cost_usd` if present |
257
+ | `"mlx"` | An MLX server on localhost (`mlx_lm.server`, or `agency local serve`) | none — `baseUrl.mlx` or `MLX_BASE_URL` (default `http://127.0.0.1:8080/v1`); no API key | Always `0` |
257
258
 
258
259
  ```ts
259
260
  import { textSync, userMessage } from "smoltalk";
@@ -275,6 +276,7 @@ const r = await textSync({
275
276
  | `deepinfra` | ✅ | ✅ | ❌ (uses per-model endpoints, not OpenAI shape) | ❌ |
276
277
  | `litellm` | ✅ | ✅ | ✅ (if the upstream model supports it) | ✅ (if upstream supports it) |
277
278
  | `openai-compat` | ✅ | ✅ | ✅ (backend-dependent) | depends on backend |
279
+ | `mlx` | ✅ | ❌ | ❌ | ❌ |
278
280
 
279
281
  Smoltalk surfaces a clear `failure(...)` from `embed()`/`image()` for the
280
282
  unsupported combinations rather than silently dropping the call.
package/dist/client.d.ts CHANGED
@@ -8,6 +8,7 @@ export * from "./clients/openaiCompat.js";
8
8
  export * from "./clients/openrouter.js";
9
9
  export * from "./clients/deepinfra.js";
10
10
  export * from "./clients/litellm.js";
11
+ export * from "./clients/mlx.js";
11
12
  import { BaseClient } from "./clients/baseClient.js";
12
13
  import { SmolClientConfig } from "./types.js";
13
14
  export declare function registerProvider(providerName: string, clientClass: typeof BaseClient): void;
package/dist/client.js CHANGED
@@ -8,6 +8,7 @@ export * from "./clients/openaiCompat.js";
8
8
  export * from "./clients/openrouter.js";
9
9
  export * from "./clients/deepinfra.js";
10
10
  export * from "./clients/litellm.js";
11
+ export * from "./clients/mlx.js";
11
12
  import { SmolAnthropic } from "./clients/anthropic.js";
12
13
  import { SmolGoogle } from "./clients/google.js";
13
14
  import { SmolOllama } from "./clients/ollama.js";
@@ -17,6 +18,7 @@ import { SmolOpenAiCompat } from "./clients/openaiCompat.js";
17
18
  import { SmolOpenRouter } from "./clients/openrouter.js";
18
19
  import { SmolDeepInfra } from "./clients/deepinfra.js";
19
20
  import { SmolLiteLlm } from "./clients/litellm.js";
21
+ import { SmolMlx } from "./clients/mlx.js";
20
22
  import { getModel, isTextModel } from "./models.js";
21
23
  import { SmolError } from "./smolError.js";
22
24
  import { resolveApiKey, resolveProvider } from "./util/provider.js";
@@ -103,6 +105,8 @@ export function getClient(config) {
103
105
  return new SmolLiteLlm(clientConfig);
104
106
  case "openai-compat":
105
107
  return new SmolOpenAiCompat(clientConfig);
108
+ case "mlx":
109
+ return new SmolMlx(clientConfig);
106
110
  default:
107
111
  if (provider in registeredProviders) {
108
112
  const ClientClass = registeredProviders[provider];
@@ -0,0 +1,15 @@
1
+ import { SmolOpenAiCompat } from "./openaiCompat.js";
2
+ import type { SmolConfig } from "../types.js";
3
+ /**
4
+ * Client for an MLX server on localhost, usually started with `mlx_lm.server`
5
+ * (or `agency local serve`). The server speaks the OpenAI chat format, so this
6
+ * is the openai-compat client with three things fixed: the base URL has a
7
+ * default, no API key is needed, and the cost is always zero.
8
+ */
9
+ export declare class SmolMlx extends SmolOpenAiCompat {
10
+ protected resolveClientOptions(config: SmolConfig): {
11
+ apiKey: string;
12
+ baseURL: string;
13
+ };
14
+ protected resolveCostUsd(): number;
15
+ }
@@ -0,0 +1,19 @@
1
+ import { SmolOpenAiCompat } from "./openaiCompat.js";
2
+ import { resolveBaseUrl } from "../util/provider.js";
3
+ /**
4
+ * Client for an MLX server on localhost, usually started with `mlx_lm.server`
5
+ * (or `agency local serve`). The server speaks the OpenAI chat format, so this
6
+ * is the openai-compat client with three things fixed: the base URL has a
7
+ * default, no API key is needed, and the cost is always zero.
8
+ */
9
+ export class SmolMlx extends SmolOpenAiCompat {
10
+ resolveClientOptions(config) {
11
+ // resolveBaseUrl always returns a value for "mlx" (it has a default).
12
+ const baseURL = resolveBaseUrl("mlx", config);
13
+ // The OpenAI SDK refuses an empty key. The local server never reads it.
14
+ return { apiKey: "mlx-local", baseURL };
15
+ }
16
+ resolveCostUsd() {
17
+ return 0;
18
+ }
19
+ }
@@ -179,7 +179,11 @@ export class SmolOpenAi extends BaseClient {
179
179
  throw new SmolContentPolicyError("Content blocked by OpenAI content filter");
180
180
  }
181
181
  const message = completion.choices[0].message;
182
- const output = message.content;
182
+ // mlx_lm.server omits `content` entirely on a tool-call reply, where OpenAI
183
+ // sends an explicit null. Coerce the missing case to null so `output`
184
+ // honors its declared `string | null` type (a no-op for real OpenAI, whose
185
+ // content is already string | null).
186
+ const output = message.content ?? null;
183
187
  const _toolCalls = message.tool_calls;
184
188
  const toolCalls = [];
185
189
  if (_toolCalls) {
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ export * from "./client.js";
2
2
  export * from "./types.js";
3
3
  export * from "./models.js";
4
4
  export * from "./modelData.js";
5
+ export * from "./modelRefresh.js";
5
6
  export * from "./model.js";
6
7
  export * from "./smolError.js";
7
8
  export * from "./util/util.js";
package/dist/index.js CHANGED
@@ -2,6 +2,7 @@ export * from "./client.js";
2
2
  export * from "./types.js";
3
3
  export * from "./models.js";
4
4
  export * from "./modelData.js";
5
+ export * from "./modelRefresh.js";
5
6
  export * from "./model.js";
6
7
  export * from "./smolError.js";
7
8
  export * from "./util/util.js";
@@ -30,11 +30,3 @@ export declare function parseModelDataBlob(raw: string): Result<ModelDataBlob>;
30
30
  export declare function deepMergeEntry<T>(base: T, overlay: T): T;
31
31
  export declare function mergeModelData(base: ModelType[], overlay: ModelType[]): ModelType[];
32
32
  export declare function mergeHostedTools(base: HostedTool[], overlay: HostedTool[]): HostedTool[];
33
- export declare const DEFAULT_MODEL_DATA_URL = "https://raw.githubusercontent.com/egonSchiele/smoltalk/main/packages/smoltalk/data/model-data.json";
34
- export type Fetcher = (url: string, signal?: AbortSignal) => Promise<string>;
35
- export type RefreshOptions = {
36
- url?: string;
37
- fetcher?: Fetcher;
38
- signal?: AbortSignal;
39
- };
40
- export declare function refreshModels(opts?: RefreshOptions): Promise<Result<ModelDataBlob>>;
package/dist/modelData.js CHANGED
@@ -1,6 +1,4 @@
1
1
  import z from "zod";
2
- import { readFile } from "node:fs/promises";
3
- import { fileURLToPath } from "node:url";
4
2
  import { success, failure } from "./types/result.js";
5
3
  export const SUPPORTED_SCHEMA_VERSION = 1;
6
4
  const EnvelopeSchema = z.object({
@@ -154,69 +152,3 @@ export function mergeModelData(base, overlay) {
154
152
  export function mergeHostedTools(base, overlay) {
155
153
  return mergeByKey(base, overlay, (t) => `${t.provider}:${t.name}`);
156
154
  }
157
- export const DEFAULT_MODEL_DATA_URL = "https://raw.githubusercontent.com/egonSchiele/smoltalk/main/packages/smoltalk/data/model-data.json";
158
- const MAX_BYTES = 10_000_000;
159
- const TIMEOUT_MS = 15_000;
160
- function enforceSizeCap(text) {
161
- if (Buffer.byteLength(text, "utf8") > MAX_BYTES) {
162
- throw new Error(`Model data exceeds the ${MAX_BYTES}-byte cap`);
163
- }
164
- return text;
165
- }
166
- // The default fetcher supports remote https:// URLs and local file:// URLs.
167
- // file:// lets users point at a self-hosted on-disk catalog (and powers the
168
- // integration test). Any other scheme is rejected.
169
- async function defaultFetcher(url, signal) {
170
- if (url.startsWith("file://")) {
171
- const path = fileURLToPath(url);
172
- const text = await readFile(path, "utf8");
173
- return enforceSizeCap(text);
174
- }
175
- if (url.startsWith("https://")) {
176
- const res = await fetch(url, { signal });
177
- if (!res.ok) {
178
- throw new Error(`HTTP ${res.status} ${res.statusText}`);
179
- }
180
- return enforceSizeCap(await res.text());
181
- }
182
- throw new Error(`Unsupported model-data URL scheme (expected https:// or file://): ${url}`);
183
- }
184
- export async function refreshModels(opts = {}) {
185
- let url = DEFAULT_MODEL_DATA_URL;
186
- if (process.env.SMOLTALK_MODEL_DATA_URL) {
187
- url = process.env.SMOLTALK_MODEL_DATA_URL;
188
- }
189
- if (opts.url) {
190
- url = opts.url;
191
- }
192
- let fetcher = defaultFetcher;
193
- if (opts.fetcher) {
194
- fetcher = opts.fetcher;
195
- }
196
- // Always drive the fetcher off our own controller so the timeout can abort
197
- // it. Forward an externally-supplied signal into the same controller so both
198
- // the timeout and the caller can cancel.
199
- const controller = new AbortController();
200
- const timer = setTimeout(() => controller.abort(), TIMEOUT_MS);
201
- if (opts.signal) {
202
- if (opts.signal.aborted) {
203
- controller.abort();
204
- }
205
- else {
206
- opts.signal.addEventListener("abort", () => controller.abort(), {
207
- once: true,
208
- });
209
- }
210
- }
211
- let raw;
212
- try {
213
- raw = await fetcher(url, controller.signal);
214
- }
215
- catch (err) {
216
- return failure(`Could not fetch model data from ${url}: ${String(err)}`);
217
- }
218
- finally {
219
- clearTimeout(timer);
220
- }
221
- return parseModelDataBlob(raw);
222
- }
@@ -0,0 +1,10 @@
1
+ import { type ModelDataBlob } from "./modelData.js";
2
+ import { Result } from "./types/result.js";
3
+ export declare const DEFAULT_MODEL_DATA_URL = "https://raw.githubusercontent.com/egonSchiele/smoltalk/main/packages/smoltalk/data/model-data.json";
4
+ export type Fetcher = (url: string, signal?: AbortSignal) => Promise<string>;
5
+ export type RefreshOptions = {
6
+ url?: string;
7
+ fetcher?: Fetcher;
8
+ signal?: AbortSignal;
9
+ };
10
+ export declare function refreshModels(opts?: RefreshOptions): Promise<Result<ModelDataBlob>>;
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Fetching refreshed model data from a remote or on-disk catalog.
3
+ *
4
+ * Split out of modelData.ts so that module — and therefore models.ts, and
5
+ * therefore the model registry — carries no Node dependency. Everything here
6
+ * needs a Node runtime (node:fs, Buffer, process.env); everything in
7
+ * modelData.ts is pure and bundles for the browser.
8
+ */
9
+ import { readFile } from "node:fs/promises";
10
+ import { fileURLToPath } from "node:url";
11
+ import { parseModelDataBlob } from "./modelData.js";
12
+ import { failure } from "./types/result.js";
13
+ export const DEFAULT_MODEL_DATA_URL = "https://raw.githubusercontent.com/egonSchiele/smoltalk/main/packages/smoltalk/data/model-data.json";
14
+ const MAX_BYTES = 10_000_000;
15
+ const TIMEOUT_MS = 15_000;
16
+ function enforceSizeCap(text) {
17
+ if (Buffer.byteLength(text, "utf8") > MAX_BYTES) {
18
+ throw new Error(`Model data exceeds the ${MAX_BYTES}-byte cap`);
19
+ }
20
+ return text;
21
+ }
22
+ // The default fetcher supports remote https:// URLs and local file:// URLs.
23
+ // file:// lets users point at a self-hosted on-disk catalog (and powers the
24
+ // integration test). Any other scheme is rejected.
25
+ async function defaultFetcher(url, signal) {
26
+ if (url.startsWith("file://")) {
27
+ const path = fileURLToPath(url);
28
+ const text = await readFile(path, "utf8");
29
+ return enforceSizeCap(text);
30
+ }
31
+ if (url.startsWith("https://")) {
32
+ const res = await fetch(url, { signal });
33
+ if (!res.ok) {
34
+ throw new Error(`HTTP ${res.status} ${res.statusText}`);
35
+ }
36
+ return enforceSizeCap(await res.text());
37
+ }
38
+ throw new Error(`Unsupported model-data URL scheme (expected https:// or file://): ${url}`);
39
+ }
40
+ export async function refreshModels(opts = {}) {
41
+ let url = DEFAULT_MODEL_DATA_URL;
42
+ if (process.env.SMOLTALK_MODEL_DATA_URL) {
43
+ url = process.env.SMOLTALK_MODEL_DATA_URL;
44
+ }
45
+ if (opts.url) {
46
+ url = opts.url;
47
+ }
48
+ let fetcher = defaultFetcher;
49
+ if (opts.fetcher) {
50
+ fetcher = opts.fetcher;
51
+ }
52
+ // Always drive the fetcher off our own controller so the timeout can abort
53
+ // it. Forward an externally-supplied signal into the same controller so both
54
+ // the timeout and the caller can cancel.
55
+ const controller = new AbortController();
56
+ const timer = setTimeout(() => controller.abort(), TIMEOUT_MS);
57
+ if (opts.signal) {
58
+ if (opts.signal.aborted) {
59
+ controller.abort();
60
+ }
61
+ else {
62
+ opts.signal.addEventListener("abort", () => controller.abort(), {
63
+ once: true,
64
+ });
65
+ }
66
+ }
67
+ let raw;
68
+ try {
69
+ raw = await fetcher(url, controller.signal);
70
+ }
71
+ catch (err) {
72
+ return failure(`Could not fetch model data from ${url}: ${String(err)}`);
73
+ }
74
+ finally {
75
+ clearTimeout(timer);
76
+ }
77
+ return parseModelDataBlob(raw);
78
+ }
package/dist/models.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { type ModelDataBlob, type HostedTool, type HostedToolPrice } from "./modelData.js";
3
- export declare const providers: readonly ["ollama", "openai", "openai-responses", "anthropic", "google", "replicate", "modal", "openrouter", "deepinfra", "litellm", "openai-compat", "groq"];
3
+ export declare const providers: readonly ["ollama", "openai", "openai-responses", "anthropic", "google", "replicate", "modal", "openrouter", "deepinfra", "litellm", "openai-compat", "groq", "mlx"];
4
4
  export declare const ProviderSchema: z.ZodEnum<{
5
5
  openai: "openai";
6
6
  anthropic: "anthropic";
@@ -14,6 +14,7 @@ export declare const ProviderSchema: z.ZodEnum<{
14
14
  litellm: "litellm";
15
15
  "openai-compat": "openai-compat";
16
16
  groq: "groq";
17
+ mlx: "mlx";
17
18
  }>;
18
19
  export type Provider = z.infer<typeof ProviderSchema>;
19
20
  export type BaseModel = {
@@ -868,16 +869,17 @@ export declare const textModels: readonly [{
868
869
  }, {
869
870
  readonly type: "text";
870
871
  readonly modelName: "gpt-5.6-sol";
871
- readonly description: "GPT-5.6 Sol is the flagship model of the GPT-5.6 family for the most complex coding and agentic tasks. 1M context window. Standard pricing for ≤272K tokens, 2x input/1.5x output for >272K. Knowledge cutoff: February 2026.";
872
+ readonly description: "GPT-5.6 Sol is the flagship model of the GPT-5.6 family for the most complex coding and agentic tasks. 1M context window. Standard pricing for ≤272K tokens, 2x input/1.5x output for >272K. Reflects the August 21, 2026 promotional price cut (input $5→$4, output $30→$20), which runs through at least November 21, 2026. Knowledge cutoff: February 2026.";
872
873
  readonly maxInputTokens: 1050000;
873
874
  readonly maxOutputTokens: 128000;
874
- readonly inputTokenCost: 5;
875
- readonly cachedInputTokenCost: 0.5;
876
- readonly outputTokenCost: 30;
875
+ readonly inputTokenCost: 4;
876
+ readonly cachedInputTokenCost: 0.4;
877
+ readonly outputTokenCost: 20;
878
+ readonly outputTokensPerSecond: 71;
877
879
  readonly longContext: {
878
- readonly inputTokenCost: 10;
879
- readonly cachedInputTokenCost: 1;
880
- readonly outputTokenCost: 45;
880
+ readonly inputTokenCost: 8;
881
+ readonly cachedInputTokenCost: 0.8;
882
+ readonly outputTokenCost: 30;
881
883
  readonly thresholdTokens: 200000;
882
884
  };
883
885
  readonly reasoning: {
@@ -908,6 +910,7 @@ export declare const textModels: readonly [{
908
910
  readonly inputTokenCost: 2;
909
911
  readonly cachedInputTokenCost: 0.2;
910
912
  readonly outputTokenCost: 12;
913
+ readonly outputTokensPerSecond: 98;
911
914
  readonly longContext: {
912
915
  readonly inputTokenCost: 4;
913
916
  readonly cachedInputTokenCost: 0.4;
@@ -942,6 +945,7 @@ export declare const textModels: readonly [{
942
945
  readonly inputTokenCost: 0.2;
943
946
  readonly cachedInputTokenCost: 0.02;
944
947
  readonly outputTokenCost: 1.2;
948
+ readonly outputTokensPerSecond: 116;
945
949
  readonly longContext: {
946
950
  readonly inputTokenCost: 0.4;
947
951
  readonly cachedInputTokenCost: 0.04;
@@ -1030,15 +1034,75 @@ export declare const textModels: readonly [{
1030
1034
  readonly temperatureSupported: true;
1031
1035
  readonly disabled: true;
1032
1036
  readonly provider: "google";
1037
+ }, {
1038
+ readonly type: "text";
1039
+ readonly modelName: "gemini-3.8-flash";
1040
+ readonly description: "Google's most intelligent Flash model (GA September 2, 2026), built on Gemini 3.7 Flash and engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows. 1M context window, 64K output. Introductory pricing $0.75 input / $3.75 output per 1M through December 31, 2026 ($1.50 / $7.50 thereafter). Thinking levels low/medium/high — `minimal` returns an error.";
1041
+ readonly maxInputTokens: 1048576;
1042
+ readonly maxOutputTokens: 65536;
1043
+ readonly inputTokenCost: 0.75;
1044
+ readonly cachedInputTokenCost: 0.075;
1045
+ readonly outputTokenCost: 3.75;
1046
+ readonly outputTokensPerSecond: 312;
1047
+ readonly inputAudioTokenCost: 1.5;
1048
+ readonly reasoning: {
1049
+ readonly levels: readonly ["low", "medium", "high"];
1050
+ readonly defaultLevel: "medium";
1051
+ readonly canDisable: false;
1052
+ readonly outputsThinking: true;
1053
+ readonly outputsSignatures: true;
1054
+ };
1055
+ readonly modalities: {
1056
+ readonly input: readonly ["text", "image", "video", "audio", "pdf"];
1057
+ readonly output: readonly ["text"];
1058
+ };
1059
+ readonly knowledge: "2026-03";
1060
+ readonly releaseDate: "2026-09-02";
1061
+ readonly lastUpdated: "2026-09-02";
1062
+ readonly family: "gemini-flash";
1063
+ readonly openWeights: false;
1064
+ readonly structuredOutput: true;
1065
+ readonly temperatureSupported: true;
1066
+ readonly provider: "google";
1067
+ }, {
1068
+ readonly type: "text";
1069
+ readonly modelName: "gemini-3.7-flash";
1070
+ readonly description: "Gemini 3.7 Flash (GA August 13, 2026) for complex coding, agentic workflows, and reliable multi-step execution. Superseded by gemini-3.8-flash but fully supported. 1M context window, 64K output. Introductory pricing $0.75 input / $3.75 output per 1M through December 31, 2026 ($1.50 / $7.50 thereafter). Thinking levels low/medium/high — `minimal` returns an error.";
1071
+ readonly maxInputTokens: 1048576;
1072
+ readonly maxOutputTokens: 65536;
1073
+ readonly inputTokenCost: 0.75;
1074
+ readonly cachedInputTokenCost: 0.075;
1075
+ readonly outputTokenCost: 3.75;
1076
+ readonly outputTokensPerSecond: 272;
1077
+ readonly inputAudioTokenCost: 1.5;
1078
+ readonly reasoning: {
1079
+ readonly levels: readonly ["low", "medium", "high"];
1080
+ readonly defaultLevel: "medium";
1081
+ readonly canDisable: false;
1082
+ readonly outputsThinking: true;
1083
+ readonly outputsSignatures: true;
1084
+ };
1085
+ readonly modalities: {
1086
+ readonly input: readonly ["text", "image", "video", "audio", "pdf"];
1087
+ readonly output: readonly ["text"];
1088
+ };
1089
+ readonly knowledge: "2026-03";
1090
+ readonly releaseDate: "2026-08-13";
1091
+ readonly lastUpdated: "2026-08-13";
1092
+ readonly family: "gemini-flash";
1093
+ readonly openWeights: false;
1094
+ readonly structuredOutput: true;
1095
+ readonly temperatureSupported: true;
1096
+ readonly provider: "google";
1033
1097
  }, {
1034
1098
  readonly type: "text";
1035
1099
  readonly modelName: "gemini-3.6-flash";
1036
- readonly description: "Latest Gemini 3.6 Flash model (GA July 21, 2026). Supersedes Gemini 3.5 Flash with better token efficiency and agentic planning at a lower output price ($7.50 vs $9.00/1M). 1M context window, 64K output. Context caching: $0.15/1M read.";
1100
+ readonly description: "Gemini 3.6 Flash (GA July 21, 2026), balancing speed and multimodal capabilities across general agentic and everyday tasks. Superseded by gemini-3.7-flash / gemini-3.8-flash. 1M context window, 64K output. Introductory pricing $0.75 input / $3.75 output per 1M through December 31, 2026 ($1.50 / $7.50 thereafter). Context caching: $0.075/1M read.";
1037
1101
  readonly maxInputTokens: 1048576;
1038
1102
  readonly maxOutputTokens: 65536;
1039
- readonly inputTokenCost: 1.5;
1040
- readonly cachedInputTokenCost: 0.15;
1041
- readonly outputTokenCost: 7.5;
1103
+ readonly inputTokenCost: 0.75;
1104
+ readonly cachedInputTokenCost: 0.075;
1105
+ readonly outputTokenCost: 3.75;
1042
1106
  readonly inputAudioTokenCost: 1.5;
1043
1107
  readonly reasoning: {
1044
1108
  readonly levels: readonly ["minimal", "low", "medium", "high"];
@@ -1127,6 +1191,7 @@ export declare const textModels: readonly [{
1127
1191
  readonly inputTokenCost: 0.3;
1128
1192
  readonly cachedInputTokenCost: 0.03;
1129
1193
  readonly outputTokenCost: 2.5;
1194
+ readonly outputTokensPerSecond: 347;
1130
1195
  readonly inputAudioTokenCost: 0.5;
1131
1196
  readonly reasoning: {
1132
1197
  readonly levels: readonly ["minimal", "low", "medium", "high"];
@@ -1380,16 +1445,75 @@ export declare const textModels: readonly [{
1380
1445
  readonly costUnit: "characters";
1381
1446
  readonly disabled: true;
1382
1447
  readonly provider: "google";
1448
+ }, {
1449
+ readonly type: "text";
1450
+ readonly modelName: "claude-fable-5-1";
1451
+ readonly description: "Anthropic's most capable widely released model, for the most demanding reasoning and long-horizon agentic work. Successor to claude-fable-5 in the same tier at the same per-token price, but cache reads are 0.025x base input ($0.25/MTok) rather than the standard 0.1x. Thinking is always on (cannot be disabled); the raw chain of thought is never returned. Forced tool use (tool_choice any/tool) returns a 400. Requires 30-day data retention (not available under zero data retention). 1M context window, 128K max output.";
1452
+ readonly maxInputTokens: 1000000;
1453
+ readonly maxOutputTokens: 128000;
1454
+ readonly inputTokenCost: 10;
1455
+ readonly cachedInputTokenCost: 0.25;
1456
+ readonly cacheCreationInputTokenCost: 12.5;
1457
+ readonly outputTokenCost: 50;
1458
+ readonly reasoning: {
1459
+ readonly thinkingStyle: "adaptive";
1460
+ readonly levels: readonly ["low", "medium", "high", "xhigh", "max"];
1461
+ readonly defaultLevel: "high";
1462
+ readonly canDisable: false;
1463
+ readonly outputsThinking: true;
1464
+ readonly outputsSignatures: true;
1465
+ };
1466
+ readonly modalities: {
1467
+ readonly input: readonly ["text", "image", "pdf"];
1468
+ readonly output: readonly ["text"];
1469
+ };
1470
+ readonly knowledge: "2026-06";
1471
+ readonly releaseDate: "2026-09-01";
1472
+ readonly lastUpdated: "2026-09-01";
1473
+ readonly family: "claude-fable";
1474
+ readonly openWeights: false;
1475
+ readonly temperatureSupported: false;
1476
+ readonly provider: "anthropic";
1477
+ }, {
1478
+ readonly type: "text";
1479
+ readonly modelName: "claude-opus-5";
1480
+ readonly description: "Opus-tier model above Opus 4.8, strongest on deep reasoning, agentic and long-horizon work, at half the cost of claude-fable-5-1. Thinking is on by default; it can be disabled only at effort `high` or below (xhigh/max return a 400). 1M context window, 128K max output.";
1481
+ readonly maxInputTokens: 1000000;
1482
+ readonly maxOutputTokens: 128000;
1483
+ readonly inputTokenCost: 5;
1484
+ readonly cachedInputTokenCost: 0.5;
1485
+ readonly cacheCreationInputTokenCost: 6.25;
1486
+ readonly outputTokenCost: 25;
1487
+ readonly reasoning: {
1488
+ readonly thinkingStyle: "adaptive";
1489
+ readonly levels: readonly ["low", "medium", "high", "xhigh", "max"];
1490
+ readonly defaultLevel: "high";
1491
+ readonly canDisable: true;
1492
+ readonly outputsThinking: true;
1493
+ readonly outputsSignatures: true;
1494
+ };
1495
+ readonly modalities: {
1496
+ readonly input: readonly ["text", "image", "pdf"];
1497
+ readonly output: readonly ["text"];
1498
+ };
1499
+ readonly knowledge: "2026-05";
1500
+ readonly releaseDate: "2026-07-24";
1501
+ readonly lastUpdated: "2026-07-24";
1502
+ readonly family: "claude-opus";
1503
+ readonly openWeights: false;
1504
+ readonly temperatureSupported: false;
1505
+ readonly provider: "anthropic";
1383
1506
  }, {
1384
1507
  readonly type: "text";
1385
1508
  readonly modelName: "claude-fable-5";
1386
- readonly description: "Anthropic's most capable widely released model, for the most demanding reasoning and long-horizon agentic work. Thinking is always on (cannot be disabled); the raw chain of thought is never returned. Requires 30-day data retention (not available under zero data retention). 1M context window, 128K max output.";
1509
+ readonly description: "Previous-generation Fable model, superseded by claude-fable-5-1 at the same per-token price (5.1 also cuts cache reads to $0.25/MTok). Thinking is always on (cannot be disabled); the raw chain of thought is never returned. Requires 30-day data retention (not available under zero data retention). 1M context window, 128K max output.";
1387
1510
  readonly maxInputTokens: 1000000;
1388
1511
  readonly maxOutputTokens: 128000;
1389
1512
  readonly inputTokenCost: 10;
1390
1513
  readonly cachedInputTokenCost: 1;
1391
1514
  readonly cacheCreationInputTokenCost: 12.5;
1392
1515
  readonly outputTokenCost: 50;
1516
+ readonly outputTokensPerSecond: 65;
1393
1517
  readonly reasoning: {
1394
1518
  readonly thinkingStyle: "adaptive";
1395
1519
  readonly levels: readonly ["low", "medium", "high", "xhigh", "max"];
@@ -1494,13 +1618,14 @@ export declare const textModels: readonly [{
1494
1618
  }, {
1495
1619
  readonly type: "text";
1496
1620
  readonly modelName: "claude-sonnet-5";
1497
- readonly description: "The best combination of speed and intelligence in the Sonnet tier, with near-Opus quality on coding and agentic work. Adaptive thinking on by default; supports the full low/medium/high/xhigh/max effort range. New tokenizer (~30% more tokens for the same text vs Sonnet 4.6). Standard pricing $3/$15; introductory $2/$10 per MTok through 2026-08-31. 1M context window, 128K max output.";
1621
+ readonly description: "The best combination of speed and intelligence in the Sonnet tier, with near-Opus quality on coding and agentic work. Adaptive thinking on by default; supports the full low/medium/high/xhigh/max effort range. New tokenizer (~30% more tokens for the same text vs Sonnet 4.6). The $2/$10 per MTok launch rate is now the standard price — the increase to $3/$15 scheduled for 2026-09-01 was cancelled. 1M context window, 128K max output.";
1498
1622
  readonly maxInputTokens: 1000000;
1499
1623
  readonly maxOutputTokens: 128000;
1500
- readonly inputTokenCost: 3;
1501
- readonly cachedInputTokenCost: 0.3;
1502
- readonly cacheCreationInputTokenCost: 3.75;
1503
- readonly outputTokenCost: 15;
1624
+ readonly inputTokenCost: 2;
1625
+ readonly cachedInputTokenCost: 0.2;
1626
+ readonly cacheCreationInputTokenCost: 2.5;
1627
+ readonly outputTokenCost: 10;
1628
+ readonly outputTokensPerSecond: 71;
1504
1629
  readonly reasoning: {
1505
1630
  readonly thinkingStyle: "adaptive";
1506
1631
  readonly levels: readonly ["low", "medium", "high", "xhigh", "max"];
package/dist/models.js CHANGED
@@ -13,6 +13,7 @@ export const providers = [
13
13
  "litellm",
14
14
  "openai-compat",
15
15
  "groq",
16
+ "mlx",
16
17
  ];
17
18
  export const ProviderSchema = z.enum(providers);
18
19
  export const speechToTextModels = [
@@ -812,16 +813,17 @@ export const textModels = [
812
813
  {
813
814
  type: "text",
814
815
  modelName: "gpt-5.6-sol",
815
- description: "GPT-5.6 Sol is the flagship model of the GPT-5.6 family for the most complex coding and agentic tasks. 1M context window. Standard pricing for ≤272K tokens, 2x input/1.5x output for >272K. Knowledge cutoff: February 2026.",
816
+ description: "GPT-5.6 Sol is the flagship model of the GPT-5.6 family for the most complex coding and agentic tasks. 1M context window. Standard pricing for ≤272K tokens, 2x input/1.5x output for >272K. Reflects the August 21, 2026 promotional price cut (input $5→$4, output $30→$20), which runs through at least November 21, 2026. Knowledge cutoff: February 2026.",
816
817
  maxInputTokens: 1050000,
817
818
  maxOutputTokens: 128000,
818
- inputTokenCost: 5,
819
- cachedInputTokenCost: 0.5,
820
- outputTokenCost: 30,
819
+ inputTokenCost: 4,
820
+ cachedInputTokenCost: 0.4,
821
+ outputTokenCost: 20,
822
+ outputTokensPerSecond: 71,
821
823
  longContext: {
822
- inputTokenCost: 10,
823
- cachedInputTokenCost: 1,
824
- outputTokenCost: 45,
824
+ inputTokenCost: 8,
825
+ cachedInputTokenCost: 0.8,
826
+ outputTokenCost: 30,
825
827
  thresholdTokens: 200000,
826
828
  },
827
829
  reasoning: {
@@ -853,6 +855,7 @@ export const textModels = [
853
855
  inputTokenCost: 2,
854
856
  cachedInputTokenCost: 0.2,
855
857
  outputTokenCost: 12,
858
+ outputTokensPerSecond: 98,
856
859
  longContext: {
857
860
  inputTokenCost: 4,
858
861
  cachedInputTokenCost: 0.4,
@@ -888,6 +891,7 @@ export const textModels = [
888
891
  inputTokenCost: 0.2,
889
892
  cachedInputTokenCost: 0.02,
890
893
  outputTokenCost: 1.2,
894
+ outputTokensPerSecond: 116,
891
895
  longContext: {
892
896
  inputTokenCost: 0.4,
893
897
  cachedInputTokenCost: 0.04,
@@ -979,15 +983,77 @@ export const textModels = [
979
983
  disabled: true,
980
984
  provider: "google",
981
985
  },
986
+ {
987
+ type: "text",
988
+ modelName: "gemini-3.8-flash",
989
+ description: "Google's most intelligent Flash model (GA September 2, 2026), built on Gemini 3.7 Flash and engineered for long-horizon software engineering, autonomous agents, and complex enterprise workflows. 1M context window, 64K output. Introductory pricing $0.75 input / $3.75 output per 1M through December 31, 2026 ($1.50 / $7.50 thereafter). Thinking levels low/medium/high — `minimal` returns an error.",
990
+ maxInputTokens: 1048576,
991
+ maxOutputTokens: 65536,
992
+ inputTokenCost: 0.75,
993
+ cachedInputTokenCost: 0.075,
994
+ outputTokenCost: 3.75,
995
+ outputTokensPerSecond: 312,
996
+ inputAudioTokenCost: 1.5,
997
+ reasoning: {
998
+ levels: ["low", "medium", "high"],
999
+ defaultLevel: "medium",
1000
+ canDisable: false,
1001
+ outputsThinking: true,
1002
+ outputsSignatures: true,
1003
+ },
1004
+ modalities: {
1005
+ input: ["text", "image", "video", "audio", "pdf"],
1006
+ output: ["text"],
1007
+ },
1008
+ knowledge: "2026-03",
1009
+ releaseDate: "2026-09-02",
1010
+ lastUpdated: "2026-09-02",
1011
+ family: "gemini-flash",
1012
+ openWeights: false,
1013
+ structuredOutput: true,
1014
+ temperatureSupported: true,
1015
+ provider: "google",
1016
+ },
1017
+ {
1018
+ type: "text",
1019
+ modelName: "gemini-3.7-flash",
1020
+ description: "Gemini 3.7 Flash (GA August 13, 2026) for complex coding, agentic workflows, and reliable multi-step execution. Superseded by gemini-3.8-flash but fully supported. 1M context window, 64K output. Introductory pricing $0.75 input / $3.75 output per 1M through December 31, 2026 ($1.50 / $7.50 thereafter). Thinking levels low/medium/high — `minimal` returns an error.",
1021
+ maxInputTokens: 1048576,
1022
+ maxOutputTokens: 65536,
1023
+ inputTokenCost: 0.75,
1024
+ cachedInputTokenCost: 0.075,
1025
+ outputTokenCost: 3.75,
1026
+ outputTokensPerSecond: 272,
1027
+ inputAudioTokenCost: 1.5,
1028
+ reasoning: {
1029
+ levels: ["low", "medium", "high"],
1030
+ defaultLevel: "medium",
1031
+ canDisable: false,
1032
+ outputsThinking: true,
1033
+ outputsSignatures: true,
1034
+ },
1035
+ modalities: {
1036
+ input: ["text", "image", "video", "audio", "pdf"],
1037
+ output: ["text"],
1038
+ },
1039
+ knowledge: "2026-03",
1040
+ releaseDate: "2026-08-13",
1041
+ lastUpdated: "2026-08-13",
1042
+ family: "gemini-flash",
1043
+ openWeights: false,
1044
+ structuredOutput: true,
1045
+ temperatureSupported: true,
1046
+ provider: "google",
1047
+ },
982
1048
  {
983
1049
  type: "text",
984
1050
  modelName: "gemini-3.6-flash",
985
- description: "Latest Gemini 3.6 Flash model (GA July 21, 2026). Supersedes Gemini 3.5 Flash with better token efficiency and agentic planning at a lower output price ($7.50 vs $9.00/1M). 1M context window, 64K output. Context caching: $0.15/1M read.",
1051
+ description: "Gemini 3.6 Flash (GA July 21, 2026), balancing speed and multimodal capabilities across general agentic and everyday tasks. Superseded by gemini-3.7-flash / gemini-3.8-flash. 1M context window, 64K output. Introductory pricing $0.75 input / $3.75 output per 1M through December 31, 2026 ($1.50 / $7.50 thereafter). Context caching: $0.075/1M read.",
986
1052
  maxInputTokens: 1048576,
987
1053
  maxOutputTokens: 65536,
988
- inputTokenCost: 1.5,
989
- cachedInputTokenCost: 0.15,
990
- outputTokenCost: 7.5,
1054
+ inputTokenCost: 0.75,
1055
+ cachedInputTokenCost: 0.075,
1056
+ outputTokenCost: 3.75,
991
1057
  inputAudioTokenCost: 1.5,
992
1058
  reasoning: {
993
1059
  levels: ["minimal", "low", "medium", "high"],
@@ -1079,6 +1145,7 @@ export const textModels = [
1079
1145
  inputTokenCost: 0.3,
1080
1146
  cachedInputTokenCost: 0.03,
1081
1147
  outputTokenCost: 2.5,
1148
+ outputTokensPerSecond: 347,
1082
1149
  inputAudioTokenCost: 0.5,
1083
1150
  reasoning: {
1084
1151
  levels: ["minimal", "low", "medium", "high"],
@@ -1347,16 +1414,77 @@ export const textModels = [
1347
1414
  disabled: true,
1348
1415
  provider: "google",
1349
1416
  },
1417
+ {
1418
+ type: "text",
1419
+ modelName: "claude-fable-5-1",
1420
+ description: "Anthropic's most capable widely released model, for the most demanding reasoning and long-horizon agentic work. Successor to claude-fable-5 in the same tier at the same per-token price, but cache reads are 0.025x base input ($0.25/MTok) rather than the standard 0.1x. Thinking is always on (cannot be disabled); the raw chain of thought is never returned. Forced tool use (tool_choice any/tool) returns a 400. Requires 30-day data retention (not available under zero data retention). 1M context window, 128K max output.",
1421
+ maxInputTokens: 1000000,
1422
+ maxOutputTokens: 128000,
1423
+ inputTokenCost: 10,
1424
+ cachedInputTokenCost: 0.25,
1425
+ cacheCreationInputTokenCost: 12.5,
1426
+ outputTokenCost: 50,
1427
+ reasoning: {
1428
+ thinkingStyle: "adaptive",
1429
+ levels: ["low", "medium", "high", "xhigh", "max"],
1430
+ defaultLevel: "high",
1431
+ canDisable: false,
1432
+ outputsThinking: true,
1433
+ outputsSignatures: true,
1434
+ },
1435
+ modalities: {
1436
+ input: ["text", "image", "pdf"],
1437
+ output: ["text"],
1438
+ },
1439
+ knowledge: "2026-06",
1440
+ releaseDate: "2026-09-01",
1441
+ lastUpdated: "2026-09-01",
1442
+ family: "claude-fable",
1443
+ openWeights: false,
1444
+ temperatureSupported: false,
1445
+ provider: "anthropic",
1446
+ },
1447
+ {
1448
+ type: "text",
1449
+ modelName: "claude-opus-5",
1450
+ description: "Opus-tier model above Opus 4.8, strongest on deep reasoning, agentic and long-horizon work, at half the cost of claude-fable-5-1. Thinking is on by default; it can be disabled only at effort `high` or below (xhigh/max return a 400). 1M context window, 128K max output.",
1451
+ maxInputTokens: 1000000,
1452
+ maxOutputTokens: 128000,
1453
+ inputTokenCost: 5,
1454
+ cachedInputTokenCost: 0.5,
1455
+ cacheCreationInputTokenCost: 6.25,
1456
+ outputTokenCost: 25,
1457
+ reasoning: {
1458
+ thinkingStyle: "adaptive",
1459
+ levels: ["low", "medium", "high", "xhigh", "max"],
1460
+ defaultLevel: "high",
1461
+ canDisable: true,
1462
+ outputsThinking: true,
1463
+ outputsSignatures: true,
1464
+ },
1465
+ modalities: {
1466
+ input: ["text", "image", "pdf"],
1467
+ output: ["text"],
1468
+ },
1469
+ knowledge: "2026-05",
1470
+ releaseDate: "2026-07-24",
1471
+ lastUpdated: "2026-07-24",
1472
+ family: "claude-opus",
1473
+ openWeights: false,
1474
+ temperatureSupported: false,
1475
+ provider: "anthropic",
1476
+ },
1350
1477
  {
1351
1478
  type: "text",
1352
1479
  modelName: "claude-fable-5",
1353
- description: "Anthropic's most capable widely released model, for the most demanding reasoning and long-horizon agentic work. Thinking is always on (cannot be disabled); the raw chain of thought is never returned. Requires 30-day data retention (not available under zero data retention). 1M context window, 128K max output.",
1480
+ description: "Previous-generation Fable model, superseded by claude-fable-5-1 at the same per-token price (5.1 also cuts cache reads to $0.25/MTok). Thinking is always on (cannot be disabled); the raw chain of thought is never returned. Requires 30-day data retention (not available under zero data retention). 1M context window, 128K max output.",
1354
1481
  maxInputTokens: 1000000,
1355
1482
  maxOutputTokens: 128000,
1356
1483
  inputTokenCost: 10,
1357
1484
  cachedInputTokenCost: 1,
1358
1485
  cacheCreationInputTokenCost: 12.5,
1359
1486
  outputTokenCost: 50,
1487
+ outputTokensPerSecond: 65,
1360
1488
  reasoning: {
1361
1489
  thinkingStyle: "adaptive",
1362
1490
  levels: ["low", "medium", "high", "xhigh", "max"],
@@ -1465,13 +1593,14 @@ export const textModels = [
1465
1593
  {
1466
1594
  type: "text",
1467
1595
  modelName: "claude-sonnet-5",
1468
- description: "The best combination of speed and intelligence in the Sonnet tier, with near-Opus quality on coding and agentic work. Adaptive thinking on by default; supports the full low/medium/high/xhigh/max effort range. New tokenizer (~30% more tokens for the same text vs Sonnet 4.6). Standard pricing $3/$15; introductory $2/$10 per MTok through 2026-08-31. 1M context window, 128K max output.",
1596
+ description: "The best combination of speed and intelligence in the Sonnet tier, with near-Opus quality on coding and agentic work. Adaptive thinking on by default; supports the full low/medium/high/xhigh/max effort range. New tokenizer (~30% more tokens for the same text vs Sonnet 4.6). The $2/$10 per MTok launch rate is now the standard price — the increase to $3/$15 scheduled for 2026-09-01 was cancelled. 1M context window, 128K max output.",
1469
1597
  maxInputTokens: 1000000,
1470
1598
  maxOutputTokens: 128000,
1471
- inputTokenCost: 3,
1472
- cachedInputTokenCost: 0.3,
1473
- cacheCreationInputTokenCost: 3.75,
1474
- outputTokenCost: 15,
1599
+ inputTokenCost: 2,
1600
+ cachedInputTokenCost: 0.2,
1601
+ cacheCreationInputTokenCost: 2.5,
1602
+ outputTokenCost: 10,
1603
+ outputTokensPerSecond: 71,
1475
1604
  reasoning: {
1476
1605
  thinkingStyle: "adaptive",
1477
1606
  levels: ["low", "medium", "high", "xhigh", "max"],
@@ -1884,7 +2013,7 @@ export const hostedTools = [
1884
2013
  category: "maps_grounding",
1885
2014
  description: "Grounding with Google Maps (Gemini 3 only).",
1886
2015
  providerToolId: "google_maps",
1887
- models: ["gemini-3-pro-preview", "gemini-3.1-pro-preview", "gemini-3-flash-preview", "gemini-3.5-flash", "gemini-3.6-flash", "gemini-3.1-flash-lite", "gemini-3.5-flash-lite"],
2016
+ models: ["gemini-3-pro-preview", "gemini-3.1-pro-preview", "gemini-3-flash-preview", "gemini-3.5-flash", "gemini-3.6-flash", "gemini-3.7-flash", "gemini-3.8-flash", "gemini-3.1-flash-lite", "gemini-3.5-flash-lite"],
1888
2017
  pricing: { unit: "per_call", note: "Gemini 3 family only; see Google pricing." },
1889
2018
  },
1890
2019
  {
package/dist/types.d.ts CHANGED
@@ -44,6 +44,8 @@ export type SmolConfig = {
44
44
  deepInfra?: string;
45
45
  liteLlm?: string;
46
46
  openAiCompat?: string;
47
+ /** The MLX server started by `mlx_lm.server` (or `agency local serve`). Defaults to http://127.0.0.1:8080/v1 (or $MLX_BASE_URL). */
48
+ mlx?: string;
47
49
  };
48
50
  /** Log level for internal debug logging. */
49
51
  logLevel?: LogLevel;
@@ -29,6 +29,7 @@ type NestedKeyConfig = {
29
29
  deepInfra?: string;
30
30
  liteLlm?: string;
31
31
  openAiCompat?: string;
32
+ mlx?: string;
32
33
  };
33
34
  };
34
35
  /**
@@ -64,6 +64,8 @@ export function resolveBaseUrl(provider, config) {
64
64
  return b?.liteLlm || process.env.LITELLM_BASE_URL;
65
65
  case "openai-compat":
66
66
  return b?.openAiCompat || process.env.OPENAI_COMPAT_BASE_URL;
67
+ case "mlx":
68
+ return b?.mlx || process.env.MLX_BASE_URL || "http://127.0.0.1:8080/v1";
67
69
  default:
68
70
  return undefined;
69
71
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smoltalk",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "description": "A common interface for LLM APIs",
5
5
  "homepage": "https://github.com/egonSchiele/smoltalk",
6
6
  "files": [
@@ -12,6 +12,11 @@
12
12
  "import": "./dist/index.js",
13
13
  "require": "./dist/index.js"
14
14
  },
15
+ "./models": {
16
+ "types": "./dist/models.d.ts",
17
+ "import": "./dist/models.js",
18
+ "require": "./dist/models.js"
19
+ },
15
20
  "./testing": {
16
21
  "types": "./dist/testing/index.d.ts",
17
22
  "import": "./dist/testing/index.js",