@hebo-ai/gateway 0.1.2 → 0.2.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.
Files changed (202) hide show
  1. package/README.md +172 -67
  2. package/dist/config.js +2 -12
  3. package/dist/endpoints/chat-completions/converters.d.ts +28 -24
  4. package/dist/endpoints/chat-completions/converters.js +99 -73
  5. package/dist/endpoints/chat-completions/handler.js +36 -30
  6. package/dist/endpoints/chat-completions/schema.d.ts +394 -272
  7. package/dist/endpoints/chat-completions/schema.js +124 -57
  8. package/dist/endpoints/embeddings/converters.d.ts +4 -4
  9. package/dist/endpoints/embeddings/converters.js +8 -9
  10. package/dist/endpoints/embeddings/handler.js +32 -26
  11. package/dist/endpoints/embeddings/schema.d.ts +28 -38
  12. package/dist/endpoints/embeddings/schema.js +10 -10
  13. package/dist/endpoints/models/converters.d.ts +2 -2
  14. package/dist/endpoints/models/converters.js +9 -12
  15. package/dist/endpoints/models/handler.js +8 -9
  16. package/dist/endpoints/models/schema.d.ts +37 -31
  17. package/dist/endpoints/models/schema.js +23 -12
  18. package/dist/gateway.d.ts +8 -9
  19. package/dist/gateway.js +7 -10
  20. package/dist/index.d.ts +2 -0
  21. package/dist/index.js +2 -0
  22. package/dist/lifecycle.d.ts +2 -0
  23. package/dist/{utils/hooks.js → lifecycle.js} +16 -8
  24. package/dist/middleware/common.d.ts +4 -0
  25. package/dist/middleware/common.js +44 -0
  26. package/dist/middleware/matcher.d.ts +18 -0
  27. package/dist/middleware/matcher.js +83 -0
  28. package/dist/models/amazon/index.d.ts +2 -0
  29. package/dist/models/amazon/index.js +2 -0
  30. package/dist/models/amazon/middleware.d.ts +2 -0
  31. package/dist/models/amazon/middleware.js +20 -0
  32. package/dist/models/amazon/presets.d.ts +2390 -0
  33. package/dist/models/amazon/presets.js +80 -0
  34. package/dist/models/anthropic/index.d.ts +2 -0
  35. package/dist/models/anthropic/index.js +2 -0
  36. package/dist/models/anthropic/middleware.d.ts +5 -0
  37. package/dist/models/anthropic/middleware.js +67 -0
  38. package/dist/models/anthropic/presets.d.ts +4106 -0
  39. package/dist/models/anthropic/presets.js +113 -0
  40. package/dist/models/catalog.d.ts +3 -1
  41. package/dist/models/catalog.js +3 -2
  42. package/dist/models/cohere/index.d.ts +2 -0
  43. package/dist/models/cohere/index.js +2 -0
  44. package/dist/models/cohere/middleware.d.ts +2 -0
  45. package/dist/models/cohere/middleware.js +18 -0
  46. package/dist/models/cohere/presets.d.ts +2918 -0
  47. package/dist/models/cohere/presets.js +129 -0
  48. package/dist/models/google/index.d.ts +2 -0
  49. package/dist/models/google/index.js +2 -0
  50. package/dist/models/google/middleware.d.ts +2 -0
  51. package/dist/models/google/middleware.js +20 -0
  52. package/dist/models/{presets/gemini.d.ts → google/presets.d.ts} +400 -174
  53. package/dist/models/{presets/gemini.js → google/presets.js} +20 -5
  54. package/dist/models/meta/index.d.ts +1 -0
  55. package/dist/models/meta/index.js +1 -0
  56. package/dist/models/meta/presets.d.ts +3254 -0
  57. package/dist/models/{presets/llama.js → meta/presets.js} +44 -7
  58. package/dist/models/openai/index.d.ts +2 -0
  59. package/dist/models/openai/index.js +2 -0
  60. package/dist/models/openai/middleware.d.ts +2 -0
  61. package/dist/models/openai/middleware.js +20 -0
  62. package/dist/models/openai/presets.d.ts +6252 -0
  63. package/dist/models/openai/presets.js +206 -0
  64. package/dist/models/types.d.ts +3 -3
  65. package/dist/models/types.js +27 -0
  66. package/dist/models/voyage/index.d.ts +2 -0
  67. package/dist/models/voyage/index.js +2 -0
  68. package/dist/models/voyage/middleware.d.ts +2 -0
  69. package/dist/models/voyage/middleware.js +18 -0
  70. package/dist/models/{presets/voyage.d.ts → voyage/presets.d.ts} +322 -323
  71. package/dist/providers/anthropic/canonical.d.ts +3 -0
  72. package/dist/providers/anthropic/canonical.js +9 -0
  73. package/dist/providers/anthropic/index.d.ts +1 -0
  74. package/dist/providers/anthropic/index.js +1 -0
  75. package/dist/providers/bedrock/canonical.d.ts +15 -0
  76. package/dist/providers/{canonical/bedrock.js → bedrock/canonical.js} +13 -15
  77. package/dist/providers/bedrock/index.d.ts +1 -0
  78. package/dist/providers/bedrock/index.js +1 -0
  79. package/dist/providers/cohere/canonical.d.ts +3 -0
  80. package/dist/providers/{canonical/cohere.js → cohere/canonical.js} +6 -6
  81. package/dist/providers/cohere/index.d.ts +1 -0
  82. package/dist/providers/cohere/index.js +1 -0
  83. package/dist/providers/groq/canonical.d.ts +3 -0
  84. package/dist/providers/groq/canonical.js +12 -0
  85. package/dist/providers/groq/index.d.ts +1 -0
  86. package/dist/providers/groq/index.js +1 -0
  87. package/dist/providers/openai/canonical.d.ts +3 -0
  88. package/dist/providers/openai/canonical.js +8 -0
  89. package/dist/providers/openai/index.d.ts +1 -0
  90. package/dist/providers/openai/index.js +1 -0
  91. package/dist/providers/registry.d.ts +16 -26
  92. package/dist/providers/registry.js +19 -26
  93. package/dist/providers/types.d.ts +1 -1
  94. package/dist/providers/types.js +1 -0
  95. package/dist/providers/vertex/canonical.d.ts +3 -0
  96. package/dist/providers/vertex/canonical.js +8 -0
  97. package/dist/providers/vertex/index.d.ts +1 -0
  98. package/dist/providers/vertex/index.js +1 -0
  99. package/dist/providers/voyage/canonical.d.ts +3 -0
  100. package/dist/providers/voyage/canonical.js +7 -0
  101. package/dist/providers/voyage/index.d.ts +1 -0
  102. package/dist/providers/voyage/index.js +1 -0
  103. package/dist/types.d.ts +60 -30
  104. package/dist/utils/errors.js +2 -0
  105. package/dist/utils/preset.d.ts +1 -7
  106. package/dist/utils/preset.js +1 -1
  107. package/dist/utils/response.d.ts +1 -0
  108. package/dist/utils/response.js +10 -0
  109. package/package.json +79 -70
  110. package/src/config.ts +2 -18
  111. package/src/endpoints/chat-completions/converters.test.ts +39 -0
  112. package/src/endpoints/chat-completions/converters.ts +191 -112
  113. package/src/endpoints/chat-completions/handler.test.ts +47 -18
  114. package/src/endpoints/chat-completions/handler.ts +40 -34
  115. package/src/endpoints/chat-completions/schema.ts +161 -88
  116. package/src/endpoints/embeddings/converters.ts +15 -11
  117. package/src/endpoints/embeddings/handler.test.ts +27 -30
  118. package/src/endpoints/embeddings/handler.ts +34 -28
  119. package/src/endpoints/embeddings/schema.ts +10 -10
  120. package/src/endpoints/models/converters.ts +22 -14
  121. package/src/endpoints/models/handler.test.ts +26 -29
  122. package/src/endpoints/models/handler.ts +10 -12
  123. package/src/endpoints/models/schema.ts +26 -20
  124. package/src/gateway.ts +10 -24
  125. package/src/index.ts +3 -0
  126. package/src/{utils/hooks.ts → lifecycle.ts} +21 -11
  127. package/src/middleware/common.ts +68 -0
  128. package/src/middleware/matcher.ts +117 -0
  129. package/src/models/amazon/index.ts +2 -0
  130. package/src/models/amazon/middleware.ts +25 -0
  131. package/src/models/amazon/presets.ts +104 -0
  132. package/src/models/anthropic/index.ts +2 -0
  133. package/src/models/anthropic/middleware.test.ts +184 -0
  134. package/src/models/anthropic/middleware.ts +75 -0
  135. package/src/models/anthropic/presets.ts +161 -0
  136. package/src/models/catalog.ts +10 -2
  137. package/src/models/cohere/index.ts +2 -0
  138. package/src/models/cohere/middleware.ts +23 -0
  139. package/src/models/cohere/presets.ts +181 -0
  140. package/src/models/google/index.ts +2 -0
  141. package/src/models/google/middleware.ts +25 -0
  142. package/src/models/{presets/gemini.ts → google/presets.ts} +25 -5
  143. package/src/models/meta/index.ts +1 -0
  144. package/src/models/{presets/llama.ts → meta/presets.ts} +68 -7
  145. package/src/models/openai/index.ts +2 -0
  146. package/src/models/openai/middleware.ts +25 -0
  147. package/src/models/openai/presets.ts +269 -0
  148. package/src/models/types.ts +29 -2
  149. package/src/models/voyage/index.ts +2 -0
  150. package/src/models/voyage/middleware.ts +23 -0
  151. package/src/providers/anthropic/canonical.ts +17 -0
  152. package/src/providers/anthropic/index.ts +1 -0
  153. package/src/providers/{canonical/bedrock.ts → bedrock/canonical.ts} +22 -32
  154. package/src/providers/bedrock/index.ts +1 -0
  155. package/src/providers/cohere/canonical.ts +26 -0
  156. package/src/providers/cohere/index.ts +1 -0
  157. package/src/providers/groq/canonical.ts +21 -0
  158. package/src/providers/groq/index.ts +1 -0
  159. package/src/providers/openai/canonical.ts +16 -0
  160. package/src/providers/openai/index.ts +1 -0
  161. package/src/providers/registry.test.ts +12 -10
  162. package/src/providers/registry.ts +43 -43
  163. package/src/providers/types.ts +1 -0
  164. package/src/providers/vertex/canonical.ts +17 -0
  165. package/src/providers/vertex/index.ts +1 -0
  166. package/src/providers/voyage/canonical.ts +16 -0
  167. package/src/providers/voyage/index.ts +1 -0
  168. package/src/types.ts +64 -28
  169. package/src/utils/errors.ts +2 -0
  170. package/src/utils/preset.ts +2 -6
  171. package/src/utils/response.ts +15 -0
  172. package/dist/models/presets/claude.d.ts +0 -1165
  173. package/dist/models/presets/claude.js +0 -40
  174. package/dist/models/presets/cohere.d.ts +0 -383
  175. package/dist/models/presets/cohere.js +0 -26
  176. package/dist/models/presets/gpt-oss.d.ts +0 -779
  177. package/dist/models/presets/gpt-oss.js +0 -40
  178. package/dist/models/presets/llama.d.ts +0 -1400
  179. package/dist/providers/canonical/anthropic.d.ts +0 -25
  180. package/dist/providers/canonical/anthropic.js +0 -14
  181. package/dist/providers/canonical/bedrock.d.ts +0 -26
  182. package/dist/providers/canonical/cohere.d.ts +0 -17
  183. package/dist/providers/canonical/groq.d.ts +0 -17
  184. package/dist/providers/canonical/groq.js +0 -10
  185. package/dist/providers/canonical/openai.d.ts +0 -17
  186. package/dist/providers/canonical/openai.js +0 -8
  187. package/dist/providers/canonical/vertex.d.ts +0 -17
  188. package/dist/providers/canonical/vertex.js +0 -10
  189. package/dist/providers/canonical/voyage.d.ts +0 -17
  190. package/dist/providers/canonical/voyage.js +0 -8
  191. package/dist/utils/hooks.d.ts +0 -2
  192. package/src/models/presets/claude.ts +0 -59
  193. package/src/models/presets/cohere.ts +0 -37
  194. package/src/models/presets/gpt-oss.ts +0 -55
  195. package/src/providers/canonical/anthropic.ts +0 -32
  196. package/src/providers/canonical/cohere.ts +0 -36
  197. package/src/providers/canonical/groq.ts +0 -25
  198. package/src/providers/canonical/openai.ts +0 -16
  199. package/src/providers/canonical/vertex.ts +0 -18
  200. package/src/providers/canonical/voyage.ts +0 -16
  201. package/dist/models/{presets/voyage.js → voyage/presets.js} +10 -10
  202. package/src/models/{presets/voyage.ts → voyage/presets.ts} +10 -10
@@ -1,25 +0,0 @@
1
- import { type AnthropicProviderSettings, type AnthropicProvider } from "@ai-sdk/anthropic";
2
- export declare const anthropicCanonicalIdAdapter: (provider: AnthropicProvider, extraMapping?: Record<string, string>) => import("@ai-sdk/provider").ProviderV3 & {
3
- languageModel(modelId: string): import("@ai-sdk/provider").LanguageModelV3;
4
- embeddingModel(modelId: string): import("@ai-sdk/provider").EmbeddingModelV3;
5
- imageModel(modelId: string): import("@ai-sdk/provider").ImageModelV3;
6
- transcriptionModel(modelId: string): import("@ai-sdk/provider").TranscriptionModelV3;
7
- rerankingModel(modelId: string): import("@ai-sdk/provider").RerankingModelV3;
8
- speechModel(modelId: string): import("@ai-sdk/provider").SpeechModelV3;
9
- };
10
- export declare const anthropicWithCanonicalIds: (extraMapping?: Record<string, string>) => import("@ai-sdk/provider").ProviderV3 & {
11
- languageModel(modelId: string): import("@ai-sdk/provider").LanguageModelV3;
12
- embeddingModel(modelId: string): import("@ai-sdk/provider").EmbeddingModelV3;
13
- imageModel(modelId: string): import("@ai-sdk/provider").ImageModelV3;
14
- transcriptionModel(modelId: string): import("@ai-sdk/provider").TranscriptionModelV3;
15
- rerankingModel(modelId: string): import("@ai-sdk/provider").RerankingModelV3;
16
- speechModel(modelId: string): import("@ai-sdk/provider").SpeechModelV3;
17
- };
18
- export declare const createAnthropicWithCanonicalIds: (settings: AnthropicProviderSettings, extraMapping?: Record<string, string>) => import("@ai-sdk/provider").ProviderV3 & {
19
- languageModel(modelId: string): import("@ai-sdk/provider").LanguageModelV3;
20
- embeddingModel(modelId: string): import("@ai-sdk/provider").EmbeddingModelV3;
21
- imageModel(modelId: string): import("@ai-sdk/provider").ImageModelV3;
22
- transcriptionModel(modelId: string): import("@ai-sdk/provider").TranscriptionModelV3;
23
- rerankingModel(modelId: string): import("@ai-sdk/provider").RerankingModelV3;
24
- speechModel(modelId: string): import("@ai-sdk/provider").SpeechModelV3;
25
- };
@@ -1,14 +0,0 @@
1
- import { createAnthropic, anthropic, } from "@ai-sdk/anthropic";
2
- import { withCanonicalIds } from "../registry";
3
- export const anthropicCanonicalIdAdapter = (provider, extraMapping) => withCanonicalIds(provider, extraMapping, {
4
- stripNamespace: true,
5
- normalizeDelimiters: true,
6
- });
7
- export const anthropicWithCanonicalIds = (extraMapping) => withCanonicalIds(anthropic, extraMapping, {
8
- stripNamespace: true,
9
- normalizeDelimiters: true,
10
- });
11
- export const createAnthropicWithCanonicalIds = (settings, extraMapping) => withCanonicalIds(createAnthropic(settings), extraMapping, {
12
- stripNamespace: true,
13
- normalizeDelimiters: true,
14
- });
@@ -1,26 +0,0 @@
1
- import { type AmazonBedrockProviderSettings } from "@ai-sdk/amazon-bedrock";
2
- export type BedrockCanonicalOptions = {
3
- /** @default "us" */
4
- geo?: "global" | "us" | "eu" | "apac" | "au" | "ca" | "jp" | "us-gov" | (string & {});
5
- arn?: {
6
- region: string;
7
- accountId: string;
8
- };
9
- };
10
- export type BedrockCanonicalSettings = AmazonBedrockProviderSettings & BedrockCanonicalOptions;
11
- export declare const bedrockWithCanonicalIds: (opts?: BedrockCanonicalOptions, extraMapping?: Record<string, string>) => import("@ai-sdk/provider").ProviderV3 & {
12
- languageModel(modelId: string): import("@ai-sdk/provider").LanguageModelV3;
13
- embeddingModel(modelId: string): import("@ai-sdk/provider").EmbeddingModelV3;
14
- imageModel(modelId: string): import("@ai-sdk/provider").ImageModelV3;
15
- transcriptionModel(modelId: string): import("@ai-sdk/provider").TranscriptionModelV3;
16
- rerankingModel(modelId: string): import("@ai-sdk/provider").RerankingModelV3;
17
- speechModel(modelId: string): import("@ai-sdk/provider").SpeechModelV3;
18
- };
19
- export declare const createAmazonBedrockWithCanonicalIds: ({ geo, arn, ...bedrockSettings }: BedrockCanonicalSettings, extraMapping?: Record<string, string>) => import("@ai-sdk/provider").ProviderV3 & {
20
- languageModel(modelId: string): import("@ai-sdk/provider").LanguageModelV3;
21
- embeddingModel(modelId: string): import("@ai-sdk/provider").EmbeddingModelV3;
22
- imageModel(modelId: string): import("@ai-sdk/provider").ImageModelV3;
23
- transcriptionModel(modelId: string): import("@ai-sdk/provider").TranscriptionModelV3;
24
- rerankingModel(modelId: string): import("@ai-sdk/provider").RerankingModelV3;
25
- speechModel(modelId: string): import("@ai-sdk/provider").SpeechModelV3;
26
- };
@@ -1,17 +0,0 @@
1
- import { type CohereProviderSettings } from "@ai-sdk/cohere";
2
- export declare const cohereWithCanonicalIds: (extraMapping?: Record<string, string>) => import("@ai-sdk/provider").ProviderV3 & {
3
- languageModel(modelId: string): import("@ai-sdk/provider").LanguageModelV3;
4
- embeddingModel(modelId: string): import("@ai-sdk/provider").EmbeddingModelV3;
5
- imageModel(modelId: string): import("@ai-sdk/provider").ImageModelV3;
6
- transcriptionModel(modelId: string): import("@ai-sdk/provider").TranscriptionModelV3;
7
- rerankingModel(modelId: string): import("@ai-sdk/provider").RerankingModelV3;
8
- speechModel(modelId: string): import("@ai-sdk/provider").SpeechModelV3;
9
- };
10
- export declare const createCohereWithCanonicalIds: (settings: CohereProviderSettings, extraMapping?: Record<string, string>) => import("@ai-sdk/provider").ProviderV3 & {
11
- languageModel(modelId: string): import("@ai-sdk/provider").LanguageModelV3;
12
- embeddingModel(modelId: string): import("@ai-sdk/provider").EmbeddingModelV3;
13
- imageModel(modelId: string): import("@ai-sdk/provider").ImageModelV3;
14
- transcriptionModel(modelId: string): import("@ai-sdk/provider").TranscriptionModelV3;
15
- rerankingModel(modelId: string): import("@ai-sdk/provider").RerankingModelV3;
16
- speechModel(modelId: string): import("@ai-sdk/provider").SpeechModelV3;
17
- };
@@ -1,17 +0,0 @@
1
- import { type GroqProviderSettings } from "@ai-sdk/groq";
2
- export declare const groqWithCanonicalIds: (extraMapping?: Record<string, string>) => import("@ai-sdk/provider").ProviderV3 & {
3
- languageModel(modelId: string): import("@ai-sdk/provider").LanguageModelV3;
4
- embeddingModel(modelId: string): import("@ai-sdk/provider").EmbeddingModelV3;
5
- imageModel(modelId: string): import("@ai-sdk/provider").ImageModelV3;
6
- transcriptionModel(modelId: string): import("@ai-sdk/provider").TranscriptionModelV3;
7
- rerankingModel(modelId: string): import("@ai-sdk/provider").RerankingModelV3;
8
- speechModel(modelId: string): import("@ai-sdk/provider").SpeechModelV3;
9
- };
10
- export declare const createGroqWithCanonicalIds: (settings: GroqProviderSettings, extraMapping?: Record<string, string>) => import("@ai-sdk/provider").ProviderV3 & {
11
- languageModel(modelId: string): import("@ai-sdk/provider").LanguageModelV3;
12
- embeddingModel(modelId: string): import("@ai-sdk/provider").EmbeddingModelV3;
13
- imageModel(modelId: string): import("@ai-sdk/provider").ImageModelV3;
14
- transcriptionModel(modelId: string): import("@ai-sdk/provider").TranscriptionModelV3;
15
- rerankingModel(modelId: string): import("@ai-sdk/provider").RerankingModelV3;
16
- speechModel(modelId: string): import("@ai-sdk/provider").SpeechModelV3;
17
- };
@@ -1,10 +0,0 @@
1
- import { createGroq, groq } from "@ai-sdk/groq";
2
- import { withCanonicalIds } from "../registry";
3
- const MAPPING = {
4
- "meta/llama-3.1-8b": "llama-3.1-8b-instant",
5
- "meta/llama-3.3-70b": "llama-3.3-70b-versatile",
6
- "meta/llama-4-scout": "meta-llama/llama-4-scout-17b-16e-instruct",
7
- "meta/llama-4-maverick": "meta-llama/llama-4-maverick-17b-128e-instruct",
8
- };
9
- export const groqWithCanonicalIds = (extraMapping) => withCanonicalIds(groq, { ...MAPPING, ...extraMapping }, { stripNamespace: false });
10
- export const createGroqWithCanonicalIds = (settings, extraMapping) => withCanonicalIds(createGroq(settings), { ...MAPPING, ...extraMapping }, { stripNamespace: false });
@@ -1,17 +0,0 @@
1
- import { type OpenAIProviderSettings } from "@ai-sdk/openai";
2
- export declare const openaiWithCanonicalIds: (extraMapping?: Record<string, string>) => import("@ai-sdk/provider").ProviderV3 & {
3
- languageModel(modelId: string): import("@ai-sdk/provider").LanguageModelV3;
4
- embeddingModel(modelId: string): import("@ai-sdk/provider").EmbeddingModelV3;
5
- imageModel(modelId: string): import("@ai-sdk/provider").ImageModelV3;
6
- transcriptionModel(modelId: string): import("@ai-sdk/provider").TranscriptionModelV3;
7
- rerankingModel(modelId: string): import("@ai-sdk/provider").RerankingModelV3;
8
- speechModel(modelId: string): import("@ai-sdk/provider").SpeechModelV3;
9
- };
10
- export declare const createOpenAIWithCanonicalIds: (settings: OpenAIProviderSettings, extraMapping?: Record<string, string>) => import("@ai-sdk/provider").ProviderV3 & {
11
- languageModel(modelId: string): import("@ai-sdk/provider").LanguageModelV3;
12
- embeddingModel(modelId: string): import("@ai-sdk/provider").EmbeddingModelV3;
13
- imageModel(modelId: string): import("@ai-sdk/provider").ImageModelV3;
14
- transcriptionModel(modelId: string): import("@ai-sdk/provider").TranscriptionModelV3;
15
- rerankingModel(modelId: string): import("@ai-sdk/provider").RerankingModelV3;
16
- speechModel(modelId: string): import("@ai-sdk/provider").SpeechModelV3;
17
- };
@@ -1,8 +0,0 @@
1
- import { createOpenAI, openai } from "@ai-sdk/openai";
2
- import { withCanonicalIds } from "../registry";
3
- export const openaiWithCanonicalIds = (extraMapping) => withCanonicalIds(openai, extraMapping, {
4
- stripNamespace: true,
5
- });
6
- export const createOpenAIWithCanonicalIds = (settings, extraMapping) => withCanonicalIds(createOpenAI(settings), extraMapping, {
7
- stripNamespace: true,
8
- });
@@ -1,17 +0,0 @@
1
- import { type GoogleVertexProviderSettings } from "@ai-sdk/google-vertex";
2
- export declare const vertexWithCanonicalIds: (extraMapping?: Record<string, string>) => import("@ai-sdk/provider").ProviderV3 & {
3
- languageModel(modelId: string): import("@ai-sdk/provider").LanguageModelV3;
4
- embeddingModel(modelId: string): import("@ai-sdk/provider").EmbeddingModelV3;
5
- imageModel(modelId: string): import("@ai-sdk/provider").ImageModelV3;
6
- transcriptionModel(modelId: string): import("@ai-sdk/provider").TranscriptionModelV3;
7
- rerankingModel(modelId: string): import("@ai-sdk/provider").RerankingModelV3;
8
- speechModel(modelId: string): import("@ai-sdk/provider").SpeechModelV3;
9
- };
10
- export declare const createVertexWithCanonicalIds: (settings: GoogleVertexProviderSettings, extraMapping?: Record<string, string>) => import("@ai-sdk/provider").ProviderV3 & {
11
- languageModel(modelId: string): import("@ai-sdk/provider").LanguageModelV3;
12
- embeddingModel(modelId: string): import("@ai-sdk/provider").EmbeddingModelV3;
13
- imageModel(modelId: string): import("@ai-sdk/provider").ImageModelV3;
14
- transcriptionModel(modelId: string): import("@ai-sdk/provider").TranscriptionModelV3;
15
- rerankingModel(modelId: string): import("@ai-sdk/provider").RerankingModelV3;
16
- speechModel(modelId: string): import("@ai-sdk/provider").SpeechModelV3;
17
- };
@@ -1,10 +0,0 @@
1
- import { createVertex, vertex } from "@ai-sdk/google-vertex";
2
- import { withCanonicalIds } from "../registry";
3
- export const vertexWithCanonicalIds = (extraMapping) => withCanonicalIds(vertex, extraMapping, {
4
- stripNamespace: true,
5
- normalizeDelimiters: ["anthropic"],
6
- });
7
- export const createVertexWithCanonicalIds = (settings, extraMapping) => withCanonicalIds(createVertex(settings), extraMapping, {
8
- stripNamespace: true,
9
- normalizeDelimiters: ["anthropic"],
10
- });
@@ -1,17 +0,0 @@
1
- import { type VoyageProviderSettings } from "voyage-ai-provider";
2
- export declare const voyageWithCanonicalIds: (extraMapping?: Record<string, string>) => import("@ai-sdk/provider").ProviderV3 & {
3
- languageModel(modelId: string): import("@ai-sdk/provider").LanguageModelV3;
4
- embeddingModel(modelId: string): import("@ai-sdk/provider").EmbeddingModelV3;
5
- imageModel(modelId: string): import("@ai-sdk/provider").ImageModelV3;
6
- transcriptionModel(modelId: string): import("@ai-sdk/provider").TranscriptionModelV3;
7
- rerankingModel(modelId: string): import("@ai-sdk/provider").RerankingModelV3;
8
- speechModel(modelId: string): import("@ai-sdk/provider").SpeechModelV3;
9
- };
10
- export declare const createVoyageWithCanonicalIds: (settings: VoyageProviderSettings, extraMapping?: Record<string, string>) => import("@ai-sdk/provider").ProviderV3 & {
11
- languageModel(modelId: string): import("@ai-sdk/provider").LanguageModelV3;
12
- embeddingModel(modelId: string): import("@ai-sdk/provider").EmbeddingModelV3;
13
- imageModel(modelId: string): import("@ai-sdk/provider").ImageModelV3;
14
- transcriptionModel(modelId: string): import("@ai-sdk/provider").TranscriptionModelV3;
15
- rerankingModel(modelId: string): import("@ai-sdk/provider").RerankingModelV3;
16
- speechModel(modelId: string): import("@ai-sdk/provider").SpeechModelV3;
17
- };
@@ -1,8 +0,0 @@
1
- import { createVoyage, voyage } from "voyage-ai-provider";
2
- import { withCanonicalIds } from "../registry";
3
- export const voyageWithCanonicalIds = (extraMapping) => withCanonicalIds(voyage, extraMapping, {
4
- stripNamespace: true,
5
- });
6
- export const createVoyageWithCanonicalIds = (settings, extraMapping) => withCanonicalIds(createVoyage(settings), extraMapping, {
7
- stripNamespace: true,
8
- });
@@ -1,2 +0,0 @@
1
- import type { GatewayHooks } from "../types";
2
- export declare const withHooks: (hooks: GatewayHooks | undefined, run: (request: Request) => Promise<Response>) => (request: Request) => Promise<Response>;
@@ -1,59 +0,0 @@
1
- import type { CanonicalProviderId } from "../../providers/types";
2
- import type { CanonicalModelId, CatalogModel } from "../types";
3
-
4
- import { presetFor, type DeepPartial } from "../../utils/preset";
5
-
6
- const CLAUDE_BASE = {
7
- modalities: {
8
- input: ["text", "image", "pdf", "file"] as const,
9
- output: ["text"] as const,
10
- },
11
- capabilities: ["attachments", "reasoning", "tool_call", "structured_output", "temperature"],
12
- context: 200000,
13
- providers: ["anthropic", "bedrock", "vertex"] as const satisfies readonly CanonicalProviderId[],
14
- } satisfies DeepPartial<CatalogModel>;
15
-
16
- export const claudeHaiku45 = presetFor<CanonicalModelId, CatalogModel>()(
17
- "anthropic/claude-haiku-4.5" as const,
18
- {
19
- name: "Claude Haiku 4.5",
20
- created: "2025-10-15",
21
- knowledge: "2025-02",
22
- ...CLAUDE_BASE,
23
- } satisfies DeepPartial<CatalogModel>,
24
- );
25
-
26
- export const claudeSonnet45 = presetFor<CanonicalModelId, CatalogModel>()(
27
- "anthropic/claude-sonnet-4.5" as const,
28
- {
29
- name: "Claude Sonnet 4.5",
30
- created: "2025-09-29",
31
- knowledge: "2025-07",
32
- ...CLAUDE_BASE,
33
- } satisfies DeepPartial<CatalogModel>,
34
- );
35
-
36
- export const claudeOpus45 = presetFor<CanonicalModelId, CatalogModel>()(
37
- "anthropic/claude-opus-4.5" as const,
38
- {
39
- name: "Claude Opus 4.5",
40
- created: "2025-11-24",
41
- knowledge: "2025-05",
42
- ...CLAUDE_BASE,
43
- } satisfies DeepPartial<CatalogModel>,
44
- );
45
-
46
- const claudeAtomic = {
47
- "v4.5": [claudeHaiku45, claudeSonnet45, claudeOpus45],
48
- } as const;
49
-
50
- const claudeGroups = {
51
- "v4.x": [...claudeAtomic["v4.5"]],
52
- } as const;
53
-
54
- export const claude = {
55
- ...claudeAtomic,
56
- ...claudeGroups,
57
- latest: [...claudeAtomic["v4.5"]],
58
- all: Object.values(claudeAtomic).flat(),
59
- } as const;
@@ -1,37 +0,0 @@
1
- import type { CanonicalProviderId } from "../../providers/types";
2
- import type { CanonicalModelId, CatalogModel } from "../types";
3
-
4
- import { presetFor, type DeepPartial } from "../../utils/preset";
5
-
6
- const COHERE_BASE = {
7
- modalities: {
8
- input: ["text"] as const,
9
- output: ["embeddings"] as const,
10
- },
11
- context: 128000,
12
- providers: ["cohere", "bedrock"] as const satisfies readonly CanonicalProviderId[],
13
- } satisfies DeepPartial<CatalogModel>;
14
-
15
- export const cohereEmbed4 = presetFor<CanonicalModelId, CatalogModel>()(
16
- "cohere/embed-v4.0" as const,
17
- {
18
- name: "Cohere 4 Embeddings",
19
- created: "2026-01-15",
20
- ...COHERE_BASE,
21
- } satisfies CatalogModel,
22
- );
23
-
24
- const cohereAtomic = {
25
- v4: [cohereEmbed4],
26
- } as const;
27
-
28
- const cohereGroups = {
29
- "v4.x": [...cohereAtomic["v4"]],
30
- } as const;
31
-
32
- export const cohere = {
33
- ...cohereAtomic,
34
- ...cohereGroups,
35
- latest: [...cohereAtomic["v4"]],
36
- all: Object.values(cohereAtomic).flat(),
37
- } as const;
@@ -1,55 +0,0 @@
1
- import type { CanonicalProviderId } from "../../providers/types";
2
- import type { CanonicalModelId, CatalogModel } from "../types";
3
-
4
- import { presetFor, type DeepPartial } from "../../utils/preset";
5
-
6
- const GPT_OSS_BASE = {
7
- modalities: {
8
- input: ["text", "file"] as const,
9
- output: ["text"] as const,
10
- },
11
- capabilities: [
12
- "attachments",
13
- "reasoning",
14
- "tool_call",
15
- "structured_output",
16
- "temperature",
17
- ] as const,
18
- context: 131072,
19
- providers: ["groq", "bedrock", "vertex"] as const satisfies readonly CanonicalProviderId[],
20
- } satisfies DeepPartial<CatalogModel>;
21
-
22
- export const gptOss20b = presetFor<CanonicalModelId, CatalogModel>()(
23
- "openai/gpt-oss-20b" as const,
24
- {
25
- name: "GPT-OSS 20B",
26
- created: "2025-08-05",
27
- knowledge: "2024-06",
28
- ...GPT_OSS_BASE,
29
- } satisfies CatalogModel,
30
- );
31
-
32
- export const gptOss120b = presetFor<CanonicalModelId, CatalogModel>()(
33
- "openai/gpt-oss-120b" as const,
34
- {
35
- name: "GPT-OSS 120B",
36
- created: "2025-08-05",
37
- knowledge: "2024-06",
38
- ...GPT_OSS_BASE,
39
- } satisfies CatalogModel,
40
- );
41
-
42
- const gptOssAtomic = {
43
- v1: [gptOss20b, gptOss120b],
44
- } as const;
45
-
46
- const gptOssGroups = {
47
- "v1.x": [...gptOssAtomic["v1"]],
48
- } as const;
49
-
50
- export const gptOss = {
51
- ...gptOssAtomic,
52
- ...gptOssGroups,
53
- latest: [...gptOssAtomic["v1"]],
54
- all: Object.values(gptOssAtomic).flat(),
55
- } as const;
@@ -1,32 +0,0 @@
1
- import {
2
- createAnthropic,
3
- anthropic,
4
- type AnthropicProviderSettings,
5
- type AnthropicProvider,
6
- } from "@ai-sdk/anthropic";
7
-
8
- import { withCanonicalIds } from "../registry";
9
-
10
- export const anthropicCanonicalIdAdapter = (
11
- provider: AnthropicProvider,
12
- extraMapping?: Record<string, string>,
13
- ) =>
14
- withCanonicalIds(provider, extraMapping, {
15
- stripNamespace: true,
16
- normalizeDelimiters: true,
17
- });
18
-
19
- export const anthropicWithCanonicalIds = (extraMapping?: Record<string, string>) =>
20
- withCanonicalIds(anthropic, extraMapping, {
21
- stripNamespace: true,
22
- normalizeDelimiters: true,
23
- });
24
-
25
- export const createAnthropicWithCanonicalIds = (
26
- settings: AnthropicProviderSettings,
27
- extraMapping?: Record<string, string>,
28
- ) =>
29
- withCanonicalIds(createAnthropic(settings), extraMapping, {
30
- stripNamespace: true,
31
- normalizeDelimiters: true,
32
- });
@@ -1,36 +0,0 @@
1
- import { createCohere, cohere, type CohereProviderSettings } from "@ai-sdk/cohere";
2
-
3
- import type { CanonicalModelId } from "../../models/types";
4
-
5
- import { withCanonicalIds } from "../registry";
6
-
7
- const MAPPING = {
8
- "cohere/command-a": "command-a-03-2025",
9
- "cohere/command-r7b": "command-r7b-12-2024",
10
- "cohere/command-a-translate": "command-a-translate-08-2025",
11
- "cohere/command-a-reasoning": "command-a-reasoning-08-2025",
12
- "cohere/command-a-vision": "command-a-vision-07-2025",
13
- "cohere/command-r": "command-r-08-2024",
14
- "cohere/command-r-plus": "command-r-plus-08-2024",
15
- } as const satisfies Partial<Record<CanonicalModelId, string>>;
16
-
17
- export const cohereWithCanonicalIds = (extraMapping?: Record<string, string>) =>
18
- withCanonicalIds(
19
- cohere,
20
- { ...MAPPING, ...extraMapping },
21
- {
22
- stripNamespace: true,
23
- },
24
- );
25
-
26
- export const createCohereWithCanonicalIds = (
27
- settings: CohereProviderSettings,
28
- extraMapping?: Record<string, string>,
29
- ) =>
30
- withCanonicalIds(
31
- createCohere(settings),
32
- { ...MAPPING, ...extraMapping },
33
- {
34
- stripNamespace: true,
35
- },
36
- );
@@ -1,25 +0,0 @@
1
- import { createGroq, groq, type GroqProviderSettings } from "@ai-sdk/groq";
2
-
3
- import type { CanonicalModelId } from "../../models/types";
4
-
5
- import { withCanonicalIds } from "../registry";
6
-
7
- const MAPPING = {
8
- "meta/llama-3.1-8b": "llama-3.1-8b-instant",
9
- "meta/llama-3.3-70b": "llama-3.3-70b-versatile",
10
- "meta/llama-4-scout": "meta-llama/llama-4-scout-17b-16e-instruct",
11
- "meta/llama-4-maverick": "meta-llama/llama-4-maverick-17b-128e-instruct",
12
- } as const satisfies Partial<Record<CanonicalModelId, string>>;
13
-
14
- export const groqWithCanonicalIds = (extraMapping?: Record<string, string>) =>
15
- withCanonicalIds(groq, { ...MAPPING, ...extraMapping }, { stripNamespace: false });
16
-
17
- export const createGroqWithCanonicalIds = (
18
- settings: GroqProviderSettings,
19
- extraMapping?: Record<string, string>,
20
- ) =>
21
- withCanonicalIds(
22
- createGroq(settings),
23
- { ...MAPPING, ...extraMapping },
24
- { stripNamespace: false },
25
- );
@@ -1,16 +0,0 @@
1
- import { createOpenAI, openai, type OpenAIProviderSettings } from "@ai-sdk/openai";
2
-
3
- import { withCanonicalIds } from "../registry";
4
-
5
- export const openaiWithCanonicalIds = (extraMapping?: Record<string, string>) =>
6
- withCanonicalIds(openai, extraMapping, {
7
- stripNamespace: true,
8
- });
9
-
10
- export const createOpenAIWithCanonicalIds = (
11
- settings: OpenAIProviderSettings,
12
- extraMapping?: Record<string, string>,
13
- ) =>
14
- withCanonicalIds(createOpenAI(settings), extraMapping, {
15
- stripNamespace: true,
16
- });
@@ -1,18 +0,0 @@
1
- import { createVertex, vertex, type GoogleVertexProviderSettings } from "@ai-sdk/google-vertex";
2
-
3
- import { withCanonicalIds } from "../registry";
4
-
5
- export const vertexWithCanonicalIds = (extraMapping?: Record<string, string>) =>
6
- withCanonicalIds(vertex, extraMapping, {
7
- stripNamespace: true,
8
- normalizeDelimiters: ["anthropic"],
9
- });
10
-
11
- export const createVertexWithCanonicalIds = (
12
- settings: GoogleVertexProviderSettings,
13
- extraMapping?: Record<string, string>,
14
- ) =>
15
- withCanonicalIds(createVertex(settings), extraMapping, {
16
- stripNamespace: true,
17
- normalizeDelimiters: ["anthropic"],
18
- });
@@ -1,16 +0,0 @@
1
- import { createVoyage, voyage, type VoyageProviderSettings } from "voyage-ai-provider";
2
-
3
- import { withCanonicalIds } from "../registry";
4
-
5
- export const voyageWithCanonicalIds = (extraMapping?: Record<string, string>) =>
6
- withCanonicalIds(voyage, extraMapping, {
7
- stripNamespace: true,
8
- });
9
-
10
- export const createVoyageWithCanonicalIds = (
11
- settings: VoyageProviderSettings,
12
- extraMapping?: Record<string, string>,
13
- ) =>
14
- withCanonicalIds(createVoyage(settings), extraMapping, {
15
- stripNamespace: true,
16
- });
@@ -7,64 +7,64 @@ const VOYAGE_BASE = {
7
7
  providers: ["voyage"],
8
8
  };
9
9
  export const voyage2Code = presetFor()("voyage/voyage-2-code", {
10
+ ...VOYAGE_BASE,
10
11
  name: "Voyage 2 Code",
11
12
  created: "2024-01-23",
12
13
  context: 16000,
13
- ...VOYAGE_BASE,
14
14
  });
15
15
  export const voyage2Finance = presetFor()("voyage/voyage-2-finance", {
16
+ ...VOYAGE_BASE,
16
17
  name: "Voyage 2 Finance",
17
18
  created: "2024-06-03",
18
19
  context: 32000,
19
- ...VOYAGE_BASE,
20
20
  });
21
21
  export const voyage2Law = presetFor()("voyage/voyage-2-law", {
22
+ ...VOYAGE_BASE,
22
23
  name: "Voyage 2 Law",
23
24
  created: "2024-04-15",
24
25
  context: 16000,
25
- ...VOYAGE_BASE,
26
26
  });
27
27
  export const voyage3Code = presetFor()("voyage/voyage-3-code", {
28
+ ...VOYAGE_BASE,
28
29
  name: "Voyage 3 Code",
29
30
  created: "2024-12-04",
30
31
  context: 32000,
31
- ...VOYAGE_BASE,
32
32
  });
33
33
  export const voyage3Large = presetFor()("voyage/voyage-3-large", {
34
+ ...VOYAGE_BASE,
34
35
  name: "Voyage 3 Large",
35
36
  created: "2025-01-07",
36
37
  context: 32000,
37
- ...VOYAGE_BASE,
38
38
  });
39
39
  export const voyage35 = presetFor()("voyage/voyage-3.5", {
40
+ ...VOYAGE_BASE,
40
41
  name: "Voyage 3.5",
41
42
  created: "2025-05-20",
42
43
  context: 32000,
43
- ...VOYAGE_BASE,
44
44
  });
45
45
  export const voyage35Lite = presetFor()("voyage/voyage-3.5-lite", {
46
+ ...VOYAGE_BASE,
46
47
  name: "Voyage 3.5 Lite",
47
48
  created: "2025-05-20",
48
49
  context: 32000,
49
- ...VOYAGE_BASE,
50
50
  });
51
51
  export const voyage4Lite = presetFor()("voyage/voyage-4-lite", {
52
+ ...VOYAGE_BASE,
52
53
  name: "Voyage 4 Lite",
53
54
  created: "2026-01-15",
54
55
  context: 32000,
55
- ...VOYAGE_BASE,
56
56
  });
57
57
  export const voyage4 = presetFor()("voyage/voyage-4", {
58
+ ...VOYAGE_BASE,
58
59
  name: "Voyage 4",
59
60
  created: "2026-01-15",
60
61
  context: 32000,
61
- ...VOYAGE_BASE,
62
62
  });
63
63
  export const voyage4Large = presetFor()("voyage/voyage-4-large", {
64
+ ...VOYAGE_BASE,
64
65
  name: "Voyage 4 Large",
65
66
  created: "2026-01-15",
66
67
  context: 32000,
67
- ...VOYAGE_BASE,
68
68
  });
69
69
  const voyageAtomic = {
70
70
  v2: [voyage2Code, voyage2Finance, voyage2Law],