smoltalk 0.3.1 → 0.4.1
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/dist/classes/message/AssistantMessage.d.ts +2 -0
- package/dist/clients/anthropic.d.ts +7 -0
- package/dist/clients/anthropic.js +168 -17
- package/dist/clients/google.js +5 -2
- package/dist/clients/openai.js +5 -2
- package/dist/clients/openaiResponses.js +5 -2
- package/dist/model.d.ts +2 -0
- package/dist/model.js +38 -5
- package/dist/models.d.ts +169 -34
- package/dist/models.js +83 -17
- package/dist/types/costEstimate.d.ts +2 -0
- package/dist/types/costEstimate.js +2 -0
- package/dist/types/tokenUsage.d.ts +2 -0
- package/dist/types/tokenUsage.js +2 -0
- package/dist/types.d.ts +4 -0
- package/package.json +1 -1
package/dist/models.js
CHANGED
|
@@ -229,7 +229,7 @@ export const textModels = [
|
|
|
229
229
|
outputsThinking: false,
|
|
230
230
|
outputsSignatures: false,
|
|
231
231
|
},
|
|
232
|
-
provider: "openai",
|
|
232
|
+
provider: "openai-responses",
|
|
233
233
|
},
|
|
234
234
|
{
|
|
235
235
|
type: "text",
|
|
@@ -248,7 +248,7 @@ export const textModels = [
|
|
|
248
248
|
outputsThinking: false,
|
|
249
249
|
outputsSignatures: false,
|
|
250
250
|
},
|
|
251
|
-
provider: "openai",
|
|
251
|
+
provider: "openai-responses",
|
|
252
252
|
},
|
|
253
253
|
{
|
|
254
254
|
type: "text",
|
|
@@ -267,7 +267,7 @@ export const textModels = [
|
|
|
267
267
|
outputsThinking: false,
|
|
268
268
|
outputsSignatures: false,
|
|
269
269
|
},
|
|
270
|
-
provider: "openai",
|
|
270
|
+
provider: "openai-responses",
|
|
271
271
|
},
|
|
272
272
|
{
|
|
273
273
|
type: "text",
|
|
@@ -285,7 +285,7 @@ export const textModels = [
|
|
|
285
285
|
outputsThinking: false,
|
|
286
286
|
outputsSignatures: false,
|
|
287
287
|
},
|
|
288
|
-
provider: "openai",
|
|
288
|
+
provider: "openai-responses",
|
|
289
289
|
},
|
|
290
290
|
{
|
|
291
291
|
type: "text",
|
|
@@ -304,7 +304,7 @@ export const textModels = [
|
|
|
304
304
|
outputsThinking: false,
|
|
305
305
|
outputsSignatures: false,
|
|
306
306
|
},
|
|
307
|
-
provider: "openai",
|
|
307
|
+
provider: "openai-responses",
|
|
308
308
|
},
|
|
309
309
|
{
|
|
310
310
|
type: "text",
|
|
@@ -319,7 +319,7 @@ export const textModels = [
|
|
|
319
319
|
outputsThinking: false,
|
|
320
320
|
outputsSignatures: false,
|
|
321
321
|
},
|
|
322
|
-
provider: "openai",
|
|
322
|
+
provider: "openai-responses",
|
|
323
323
|
},
|
|
324
324
|
{
|
|
325
325
|
type: "text",
|
|
@@ -337,7 +337,7 @@ export const textModels = [
|
|
|
337
337
|
outputsThinking: false,
|
|
338
338
|
outputsSignatures: false,
|
|
339
339
|
},
|
|
340
|
-
provider: "openai",
|
|
340
|
+
provider: "openai-responses",
|
|
341
341
|
},
|
|
342
342
|
{
|
|
343
343
|
type: "text",
|
|
@@ -356,7 +356,7 @@ export const textModels = [
|
|
|
356
356
|
outputsThinking: false,
|
|
357
357
|
outputsSignatures: false,
|
|
358
358
|
},
|
|
359
|
-
provider: "openai",
|
|
359
|
+
provider: "openai-responses",
|
|
360
360
|
},
|
|
361
361
|
{
|
|
362
362
|
type: "text",
|
|
@@ -375,7 +375,7 @@ export const textModels = [
|
|
|
375
375
|
outputsThinking: false,
|
|
376
376
|
outputsSignatures: false,
|
|
377
377
|
},
|
|
378
|
-
provider: "openai",
|
|
378
|
+
provider: "openai-responses",
|
|
379
379
|
},
|
|
380
380
|
{
|
|
381
381
|
type: "text",
|
|
@@ -392,7 +392,7 @@ export const textModels = [
|
|
|
392
392
|
outputsThinking: false,
|
|
393
393
|
outputsSignatures: false,
|
|
394
394
|
},
|
|
395
|
-
provider: "openai",
|
|
395
|
+
provider: "openai-responses",
|
|
396
396
|
},
|
|
397
397
|
{
|
|
398
398
|
type: "text",
|
|
@@ -411,7 +411,7 @@ export const textModels = [
|
|
|
411
411
|
outputsThinking: false,
|
|
412
412
|
outputsSignatures: false,
|
|
413
413
|
},
|
|
414
|
-
provider: "openai",
|
|
414
|
+
provider: "openai-responses",
|
|
415
415
|
},
|
|
416
416
|
{
|
|
417
417
|
type: "text",
|
|
@@ -428,7 +428,7 @@ export const textModels = [
|
|
|
428
428
|
outputsThinking: false,
|
|
429
429
|
outputsSignatures: false,
|
|
430
430
|
},
|
|
431
|
-
provider: "openai",
|
|
431
|
+
provider: "openai-responses",
|
|
432
432
|
},
|
|
433
433
|
{
|
|
434
434
|
type: "text",
|
|
@@ -459,10 +459,28 @@ export const textModels = [
|
|
|
459
459
|
disabled: true,
|
|
460
460
|
provider: "google",
|
|
461
461
|
},
|
|
462
|
+
{
|
|
463
|
+
type: "text",
|
|
464
|
+
modelName: "gemini-3.5-flash",
|
|
465
|
+
description: "Latest Gemini 3.5 Flash model (GA May 2026). Outperforms Gemini 3.1 Pro on coding and agentic suites at 4x the speed. 1M context window, 64K output. Context caching: $0.15/1M read.",
|
|
466
|
+
maxInputTokens: 1_048_576,
|
|
467
|
+
maxOutputTokens: 65536,
|
|
468
|
+
inputTokenCost: 1.5,
|
|
469
|
+
cachedInputTokenCost: 0.15,
|
|
470
|
+
outputTokenCost: 9.0,
|
|
471
|
+
reasoning: {
|
|
472
|
+
levels: ["minimal", "low", "medium", "high"],
|
|
473
|
+
defaultLevel: "high",
|
|
474
|
+
canDisable: false,
|
|
475
|
+
outputsThinking: true,
|
|
476
|
+
outputsSignatures: true,
|
|
477
|
+
},
|
|
478
|
+
provider: "google",
|
|
479
|
+
},
|
|
462
480
|
{
|
|
463
481
|
type: "text",
|
|
464
482
|
modelName: "gemini-3-flash-preview",
|
|
465
|
-
description: "
|
|
483
|
+
description: "Gemini 3 Flash preview. Superseded by gemini-3.5-flash. 1M context window and 64K output. Optimized for agentic workflows and coding.",
|
|
466
484
|
maxInputTokens: 1_048_576,
|
|
467
485
|
maxOutputTokens: 65536,
|
|
468
486
|
inputTokenCost: 0.5,
|
|
@@ -479,8 +497,8 @@ export const textModels = [
|
|
|
479
497
|
},
|
|
480
498
|
{
|
|
481
499
|
type: "text",
|
|
482
|
-
modelName: "gemini-3.1-flash-lite
|
|
483
|
-
description: "Most cost-effective Gemini 3.1 model
|
|
500
|
+
modelName: "gemini-3.1-flash-lite",
|
|
501
|
+
description: "Most cost-effective Gemini 3.1 model (GA). Thinking support, 1M context window, 64K output. 2.5x faster TTFA and 45% faster output than 2.5 Flash.",
|
|
484
502
|
maxInputTokens: 1_048_576,
|
|
485
503
|
maxOutputTokens: 65536,
|
|
486
504
|
inputTokenCost: 0.25,
|
|
@@ -495,6 +513,17 @@ export const textModels = [
|
|
|
495
513
|
},
|
|
496
514
|
provider: "google",
|
|
497
515
|
},
|
|
516
|
+
{
|
|
517
|
+
type: "text",
|
|
518
|
+
modelName: "gemini-3.1-flash-lite-preview",
|
|
519
|
+
description: "DEPRECATED: Preview version, discontinued July 9, 2026. Use gemini-3.1-flash-lite instead.",
|
|
520
|
+
maxInputTokens: 1_048_576,
|
|
521
|
+
maxOutputTokens: 65536,
|
|
522
|
+
inputTokenCost: 0.25,
|
|
523
|
+
outputTokenCost: 1.5,
|
|
524
|
+
disabled: true,
|
|
525
|
+
provider: "google",
|
|
526
|
+
},
|
|
498
527
|
{
|
|
499
528
|
type: "text",
|
|
500
529
|
modelName: "gemini-2.5-pro",
|
|
@@ -502,6 +531,7 @@ export const textModels = [
|
|
|
502
531
|
maxInputTokens: 2_097_152,
|
|
503
532
|
maxOutputTokens: 65536,
|
|
504
533
|
inputTokenCost: 1.25,
|
|
534
|
+
cachedInputTokenCost: 0.31,
|
|
505
535
|
outputTokenCost: 10.0,
|
|
506
536
|
outputTokensPerSecond: 145,
|
|
507
537
|
reasoning: {
|
|
@@ -518,6 +548,7 @@ export const textModels = [
|
|
|
518
548
|
maxInputTokens: 1_048_576,
|
|
519
549
|
maxOutputTokens: 65536,
|
|
520
550
|
inputTokenCost: 0.3,
|
|
551
|
+
cachedInputTokenCost: 0.075,
|
|
521
552
|
outputTokenCost: 2.5,
|
|
522
553
|
outputTokensPerSecond: 245,
|
|
523
554
|
reasoning: {
|
|
@@ -534,6 +565,7 @@ export const textModels = [
|
|
|
534
565
|
maxInputTokens: 1_048_576,
|
|
535
566
|
maxOutputTokens: 65536,
|
|
536
567
|
inputTokenCost: 0.1,
|
|
568
|
+
cachedInputTokenCost: 0.025,
|
|
537
569
|
outputTokenCost: 0.4,
|
|
538
570
|
outputTokensPerSecond: 400,
|
|
539
571
|
reasoning: {
|
|
@@ -615,17 +647,36 @@ export const textModels = [
|
|
|
615
647
|
disabled: true,
|
|
616
648
|
provider: "google",
|
|
617
649
|
},
|
|
650
|
+
{
|
|
651
|
+
type: "text",
|
|
652
|
+
modelName: "claude-opus-4-8",
|
|
653
|
+
description: "The most capable Claude model for complex reasoning and agentic coding. Same per-token pricing as Opus 4.7 with improved tool-use efficiency (~290 tokens for tool-use system prompt vs 675 on 4.7). 1M context window, 128K max output.",
|
|
654
|
+
maxInputTokens: 1_000_000,
|
|
655
|
+
maxOutputTokens: 128_000,
|
|
656
|
+
inputTokenCost: 5,
|
|
657
|
+
cachedInputTokenCost: 0.5,
|
|
658
|
+
outputTokenCost: 25,
|
|
659
|
+
reasoning: {
|
|
660
|
+
thinkingStyle: "adaptive",
|
|
661
|
+
canDisable: false,
|
|
662
|
+
outputsThinking: true,
|
|
663
|
+
outputsSignatures: true,
|
|
664
|
+
},
|
|
665
|
+
provider: "anthropic",
|
|
666
|
+
},
|
|
618
667
|
{
|
|
619
668
|
type: "text",
|
|
620
669
|
modelName: "claude-opus-4-7",
|
|
621
|
-
description: "
|
|
670
|
+
description: "Claude Opus 4.7 for complex reasoning and agentic coding. Features Adaptive Thinking that auto-tunes reasoning compute per request. 1M context window, 128K max output. Knowledge cutoff: January 2026.",
|
|
622
671
|
maxInputTokens: 1_000_000,
|
|
623
672
|
maxOutputTokens: 128_000,
|
|
624
673
|
inputTokenCost: 5,
|
|
625
674
|
cachedInputTokenCost: 0.5,
|
|
675
|
+
cacheCreationInputTokenCost: 6.25,
|
|
626
676
|
outputTokenCost: 25,
|
|
627
677
|
outputTokensPerSecond: 72,
|
|
628
678
|
reasoning: {
|
|
679
|
+
thinkingStyle: "adaptive",
|
|
629
680
|
canDisable: false,
|
|
630
681
|
outputsThinking: true,
|
|
631
682
|
outputsSignatures: true,
|
|
@@ -640,9 +691,11 @@ export const textModels = [
|
|
|
640
691
|
maxOutputTokens: 128_000,
|
|
641
692
|
inputTokenCost: 5,
|
|
642
693
|
cachedInputTokenCost: 0.5,
|
|
694
|
+
cacheCreationInputTokenCost: 6.25,
|
|
643
695
|
outputTokenCost: 25,
|
|
644
696
|
outputTokensPerSecond: 53,
|
|
645
697
|
reasoning: {
|
|
698
|
+
thinkingStyle: "adaptive",
|
|
646
699
|
canDisable: true,
|
|
647
700
|
outputsThinking: true,
|
|
648
701
|
outputsSignatures: true,
|
|
@@ -657,9 +710,11 @@ export const textModels = [
|
|
|
657
710
|
maxOutputTokens: 64_000,
|
|
658
711
|
inputTokenCost: 3,
|
|
659
712
|
cachedInputTokenCost: 0.3,
|
|
713
|
+
cacheCreationInputTokenCost: 3.75,
|
|
660
714
|
outputTokenCost: 15,
|
|
661
715
|
outputTokensPerSecond: 52,
|
|
662
716
|
reasoning: {
|
|
717
|
+
thinkingStyle: "adaptive",
|
|
663
718
|
canDisable: true,
|
|
664
719
|
outputsThinking: true,
|
|
665
720
|
outputsSignatures: true,
|
|
@@ -674,9 +729,11 @@ export const textModels = [
|
|
|
674
729
|
maxOutputTokens: 64_000,
|
|
675
730
|
inputTokenCost: 1,
|
|
676
731
|
cachedInputTokenCost: 0.1,
|
|
732
|
+
cacheCreationInputTokenCost: 1.25,
|
|
677
733
|
outputTokenCost: 5,
|
|
678
734
|
outputTokensPerSecond: 97,
|
|
679
735
|
reasoning: {
|
|
736
|
+
thinkingStyle: "budget",
|
|
680
737
|
canDisable: true,
|
|
681
738
|
outputsThinking: true,
|
|
682
739
|
outputsSignatures: true,
|
|
@@ -693,6 +750,7 @@ export const textModels = [
|
|
|
693
750
|
outputTokenCost: 15,
|
|
694
751
|
outputTokensPerSecond: 78,
|
|
695
752
|
reasoning: {
|
|
753
|
+
thinkingStyle: "budget",
|
|
696
754
|
canDisable: true,
|
|
697
755
|
outputsThinking: true,
|
|
698
756
|
outputsSignatures: true,
|
|
@@ -751,7 +809,15 @@ export const imageModels = [
|
|
|
751
809
|
type: "image",
|
|
752
810
|
modelName: "gemini-3.1-flash-image-preview",
|
|
753
811
|
provider: "google",
|
|
754
|
-
description: "
|
|
812
|
+
description: "DEPRECATED: Preview version. Use gemini-3.1-flash-image instead.",
|
|
813
|
+
costPerImage: 0.067,
|
|
814
|
+
disabled: true,
|
|
815
|
+
},
|
|
816
|
+
{
|
|
817
|
+
type: "image",
|
|
818
|
+
modelName: "gemini-3.1-flash-image",
|
|
819
|
+
provider: "google",
|
|
820
|
+
description: "Fast image generation with Gemini 3.1 Flash (GA). Supports resolutions from 512px to 4096px. ~$0.045/image at 512px, $0.067 at 1K, $0.101 at 2K, $0.151 at 4K.",
|
|
755
821
|
costPerImage: 0.067,
|
|
756
822
|
},
|
|
757
823
|
];
|
|
@@ -3,6 +3,7 @@ export type CostEstimate = {
|
|
|
3
3
|
inputCost: number;
|
|
4
4
|
outputCost: number;
|
|
5
5
|
cachedInputCost?: number;
|
|
6
|
+
cacheCreationInputCost?: number;
|
|
6
7
|
totalCost: number;
|
|
7
8
|
currency: string;
|
|
8
9
|
};
|
|
@@ -10,6 +11,7 @@ export declare const CostEstimateSchema: z.ZodObject<{
|
|
|
10
11
|
inputCost: z.ZodNumber;
|
|
11
12
|
outputCost: z.ZodNumber;
|
|
12
13
|
cachedInputCost: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
cacheCreationInputCost: z.ZodOptional<z.ZodNumber>;
|
|
13
15
|
totalCost: z.ZodNumber;
|
|
14
16
|
currency: z.ZodString;
|
|
15
17
|
}, z.core.$strip>;
|
|
@@ -3,6 +3,7 @@ export const CostEstimateSchema = z.object({
|
|
|
3
3
|
inputCost: z.number(),
|
|
4
4
|
outputCost: z.number(),
|
|
5
5
|
cachedInputCost: z.number().optional(),
|
|
6
|
+
cacheCreationInputCost: z.number().optional(),
|
|
6
7
|
totalCost: z.number(),
|
|
7
8
|
currency: z.string(),
|
|
8
9
|
});
|
|
@@ -24,6 +25,7 @@ export function addCosts(_a, _b) {
|
|
|
24
25
|
inputCost: a.inputCost + b.inputCost,
|
|
25
26
|
outputCost: a.outputCost + b.outputCost,
|
|
26
27
|
cachedInputCost: (a.cachedInputCost || 0) + (b.cachedInputCost || 0),
|
|
28
|
+
cacheCreationInputCost: (a.cacheCreationInputCost || 0) + (b.cacheCreationInputCost || 0),
|
|
27
29
|
totalCost: a.totalCost + b.totalCost,
|
|
28
30
|
currency: a.currency,
|
|
29
31
|
};
|
|
@@ -3,12 +3,14 @@ export type TokenUsage = {
|
|
|
3
3
|
inputTokens: number;
|
|
4
4
|
outputTokens: number;
|
|
5
5
|
cachedInputTokens?: number;
|
|
6
|
+
cacheCreationInputTokens?: number;
|
|
6
7
|
totalTokens?: number;
|
|
7
8
|
};
|
|
8
9
|
export declare const TokenUsageSchema: z.ZodObject<{
|
|
9
10
|
inputTokens: z.ZodNumber;
|
|
10
11
|
outputTokens: z.ZodNumber;
|
|
11
12
|
cachedInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
cacheCreationInputTokens: z.ZodOptional<z.ZodNumber>;
|
|
12
14
|
totalTokens: z.ZodOptional<z.ZodNumber>;
|
|
13
15
|
}, z.core.$strip>;
|
|
14
16
|
export declare function addTokenUsage(_a?: TokenUsage, _b?: TokenUsage): TokenUsage;
|
package/dist/types/tokenUsage.js
CHANGED
|
@@ -3,6 +3,7 @@ export const TokenUsageSchema = z.object({
|
|
|
3
3
|
inputTokens: z.number(),
|
|
4
4
|
outputTokens: z.number(),
|
|
5
5
|
cachedInputTokens: z.number().optional(),
|
|
6
|
+
cacheCreationInputTokens: z.number().optional(),
|
|
6
7
|
totalTokens: z.number().optional(),
|
|
7
8
|
});
|
|
8
9
|
export function addTokenUsage(_a, _b) {
|
|
@@ -20,6 +21,7 @@ export function addTokenUsage(_a, _b) {
|
|
|
20
21
|
inputTokens: a.inputTokens + b.inputTokens,
|
|
21
22
|
outputTokens: a.outputTokens + b.outputTokens,
|
|
22
23
|
cachedInputTokens: (a.cachedInputTokens || 0) + (b.cachedInputTokens || 0),
|
|
24
|
+
cacheCreationInputTokens: (a.cacheCreationInputTokens || 0) + (b.cacheCreationInputTokens || 0),
|
|
23
25
|
totalTokens: (a.totalTokens || 0) + (b.totalTokens || 0),
|
|
24
26
|
};
|
|
25
27
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -69,6 +69,10 @@ export type SmolConfig = {
|
|
|
69
69
|
enabled: boolean;
|
|
70
70
|
budgetTokens?: number;
|
|
71
71
|
};
|
|
72
|
+
/** Prompt caching. Currently used by Anthropic; OpenAI/Google cache automatically. Defaults to enabled. */
|
|
73
|
+
caching?: {
|
|
74
|
+
enabled?: boolean;
|
|
75
|
+
};
|
|
72
76
|
/** Provider-agnostic reasoning effort level. */
|
|
73
77
|
reasoningEffort?: "low" | "medium" | "high";
|
|
74
78
|
responseFormatOptions?: Partial<{
|