@vellumai/assistant 0.11.7-dev.202609011858.9cc8acb → 0.11.7-dev.202609012016.14eabff

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": "@vellumai/assistant",
3
- "version": "0.11.7-dev.202609011858.9cc8acb",
3
+ "version": "0.11.7-dev.202609012016.14eabff",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -3602,6 +3602,8 @@ describe("AnthropicProvider — deprecated sampling params (temperature / top_p
3602
3602
  "claude-sonnet-5",
3603
3603
  "anthropic/claude-sonnet-5",
3604
3604
  "claude-fable-5",
3605
+ "claude-fable-5-1",
3606
+ "anthropic/claude-fable-5.1",
3605
3607
  ]) {
3606
3608
  test(`strips temperature, top_p, and top_k for ${model}`, async () => {
3607
3609
  const provider = new AnthropicProvider("sk-ant-test", model);
@@ -20,7 +20,7 @@ describe("model intents", () => {
20
20
  "claude-haiku-4-5-20251001",
21
21
  );
22
22
  expect(resolveModelIntent("anthropic", "quality-optimized")).toBe(
23
- "claude-fable-5",
23
+ "claude-fable-5-1",
24
24
  );
25
25
  expect(resolveModelIntent("anthropic", "vision-optimized")).toBe(
26
26
  "claude-opus-4-6",
@@ -47,7 +47,7 @@ describe("model intents", () => {
47
47
  "anthropic/claude-haiku-4.5",
48
48
  );
49
49
  expect(resolveModelIntent("vercel-ai-gateway", "quality-optimized")).toBe(
50
- "anthropic/claude-fable-5",
50
+ "anthropic/claude-fable-5.1",
51
51
  );
52
52
  expect(resolveModelIntent("vercel-ai-gateway", "vision-optimized")).toBe(
53
53
  "anthropic/claude-opus-4.6",
@@ -450,6 +450,19 @@ describe("resolvePricingForUsage", () => {
450
450
  expect(result.estimatedCostUsd).toBeCloseTo(57.4, 10);
451
451
  });
452
452
 
453
+ test("bills Fable 5.1 cache reads at the catalog rate", () => {
454
+ const result = resolvePricingForUsage("anthropic", "claude-fable-5-1", {
455
+ directInputTokens: 0,
456
+ outputTokens: 0,
457
+ cacheCreationInputTokens: 0,
458
+ cacheReadInputTokens: 1_000_000,
459
+ anthropicCacheCreation: null,
460
+ });
461
+
462
+ expect(result.pricingStatus).toBe("priced");
463
+ expect(result.estimatedCostUsd).toBeCloseTo(0.25, 10);
464
+ });
465
+
453
466
  test("returns unpriced with null cost for unknown provider", () => {
454
467
  const usage: PricingUsage = {
455
468
  directInputTokens: 10,
@@ -1056,7 +1056,7 @@ export class AnthropicProvider implements Provider {
1056
1056
  /claude-opus-4-[78]\b/.test(effectiveModel) ||
1057
1057
  /claude-opus-5\b/.test(effectiveModel) ||
1058
1058
  /claude-sonnet-5\b/.test(effectiveModel) ||
1059
- effectiveModel.startsWith("claude-fable-");
1059
+ /claude-fable-/.test(effectiveModel);
1060
1060
  const mergedOutputConfig = {
1061
1061
  ...(output_config ?? {}),
1062
1062
  ...(effort && effort !== "none" && supportsEffort
@@ -193,6 +193,24 @@ const RAW_PROVIDER_CATALOG: ProviderCatalogEntry[] = [
193
193
  linkLabel: "Open Anthropic Console",
194
194
  },
195
195
  models: [
196
+ {
197
+ id: "claude-fable-5-1",
198
+ displayName: "Claude Fable 5.1",
199
+ contextWindowTokens: 1000000,
200
+ maxOutputTokens: 128000,
201
+ longContextPricingThresholdTokens: 200000,
202
+ supportsThinking: true,
203
+ adaptiveThinkingOnly: true,
204
+ supportsCaching: true,
205
+ supportsVision: true,
206
+ supportsToolUse: true,
207
+ pricing: {
208
+ inputPer1mTokens: 10,
209
+ outputPer1mTokens: 50,
210
+ cacheWritePer1mTokens: 12.5,
211
+ cacheReadPer1mTokens: 0.25,
212
+ },
213
+ },
196
214
  {
197
215
  id: "claude-fable-5",
198
216
  displayName: "Claude Fable 5",
@@ -1086,6 +1104,24 @@ const RAW_PROVIDER_CATALOG: ProviderCatalogEntry[] = [
1086
1104
  // OpenRouter proxies anthropic/* through Anthropic's Messages API, so
1087
1105
  // prompt caching and cache TTL metadata pass through unchanged and
1088
1106
  // billing matches Anthropic's direct rates.
1107
+ {
1108
+ id: "anthropic/claude-fable-5.1",
1109
+ displayName: "Claude Fable 5.1",
1110
+ contextWindowTokens: 1000000,
1111
+ maxOutputTokens: 128000,
1112
+ longContextPricingThresholdTokens: 200000,
1113
+ supportsThinking: true,
1114
+ adaptiveThinkingOnly: true,
1115
+ supportsCaching: true,
1116
+ supportsVision: true,
1117
+ supportsToolUse: true,
1118
+ pricing: {
1119
+ inputPer1mTokens: 10,
1120
+ outputPer1mTokens: 50,
1121
+ cacheWritePer1mTokens: 12.5,
1122
+ cacheReadPer1mTokens: 0.25,
1123
+ },
1124
+ },
1089
1125
  {
1090
1126
  id: "anthropic/claude-fable-5",
1091
1127
  displayName: "Claude Fable 5",
@@ -1934,6 +1970,24 @@ const RAW_PROVIDER_CATALOG: ProviderCatalogEntry[] = [
1934
1970
  // The gateway proxies anthropic/* through Anthropic's Messages API, so
1935
1971
  // prompt caching and cache TTL metadata pass through unchanged and
1936
1972
  // billing matches Anthropic's direct rates.
1973
+ {
1974
+ id: "anthropic/claude-fable-5.1",
1975
+ displayName: "Claude Fable 5.1",
1976
+ contextWindowTokens: 1000000,
1977
+ maxOutputTokens: 128000,
1978
+ longContextPricingThresholdTokens: 200000,
1979
+ supportsThinking: true,
1980
+ adaptiveThinkingOnly: true,
1981
+ supportsCaching: true,
1982
+ supportsVision: true,
1983
+ supportsToolUse: true,
1984
+ pricing: {
1985
+ inputPer1mTokens: 10,
1986
+ outputPer1mTokens: 50,
1987
+ cacheWritePer1mTokens: 12.5,
1988
+ cacheReadPer1mTokens: 0.25,
1989
+ },
1990
+ },
1937
1991
  {
1938
1992
  id: "anthropic/claude-fable-5",
1939
1993
  displayName: "Claude Fable 5",
@@ -20,7 +20,7 @@ const PROVIDER_MODEL_INTENTS: Record<string, Record<ModelIntent, string>> = {
20
20
  balanced: "claude-sonnet-4-6",
21
21
  "cost-optimized": "claude-haiku-4-5-20251001",
22
22
  "latency-optimized": "claude-haiku-4-5-20251001",
23
- "quality-optimized": "claude-fable-5",
23
+ "quality-optimized": "claude-fable-5-1",
24
24
  "vision-optimized": "claude-opus-4-6",
25
25
  },
26
26
  openai: {
@@ -55,14 +55,14 @@ const PROVIDER_MODEL_INTENTS: Record<string, Record<ModelIntent, string>> = {
55
55
  balanced: "anthropic/claude-sonnet-4.6",
56
56
  "cost-optimized": "deepseek/deepseek-v4-flash",
57
57
  "latency-optimized": "anthropic/claude-haiku-4.5",
58
- "quality-optimized": "anthropic/claude-fable-5",
58
+ "quality-optimized": "anthropic/claude-fable-5.1",
59
59
  "vision-optimized": "anthropic/claude-opus-4.6",
60
60
  },
61
61
  "vercel-ai-gateway": {
62
62
  balanced: "anthropic/claude-sonnet-4.6",
63
63
  "cost-optimized": "deepseek/deepseek-v4-flash",
64
64
  "latency-optimized": "anthropic/claude-haiku-4.5",
65
- "quality-optimized": "anthropic/claude-fable-5",
65
+ "quality-optimized": "anthropic/claude-fable-5.1",
66
66
  "vision-optimized": "anthropic/claude-opus-4.6",
67
67
  },
68
68
  };
@@ -380,7 +380,8 @@ function calculateUsageCost(
380
380
  directInputCost +
381
381
  outputCost +
382
382
  calculateTokenCost(
383
- effectivePricing.inputPer1M * ANTHROPIC_PROMPT_CACHE_MULTIPLIERS.read,
383
+ effectivePricing.cacheReadPer1M ??
384
+ effectivePricing.inputPer1M * ANTHROPIC_PROMPT_CACHE_MULTIPLIERS.read,
384
385
  usage.cacheReadInputTokens,
385
386
  ) +
386
387
  calculateTokenCost(