@abhishek944/pi-embeddings 0.0.0-stage → 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 (51) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +97 -2
  3. package/dist/errors.d.ts +21 -0
  4. package/dist/errors.js +41 -0
  5. package/dist/execute.d.ts +25 -0
  6. package/dist/execute.js +264 -0
  7. package/dist/extension.d.ts +2 -0
  8. package/dist/extension.js +164 -0
  9. package/dist/index.d.ts +5 -0
  10. package/dist/index.js +4 -0
  11. package/dist/local-runtime.d.ts +14 -0
  12. package/dist/local-runtime.js +246 -0
  13. package/dist/mcp-cli.d.ts +2 -0
  14. package/dist/mcp-cli.js +46 -0
  15. package/dist/mcp-server.d.ts +23 -0
  16. package/dist/mcp-server.js +141 -0
  17. package/dist/provider-http.d.ts +11 -0
  18. package/dist/provider-http.js +60 -0
  19. package/dist/provider-types.d.ts +30 -0
  20. package/dist/provider-types.js +1 -0
  21. package/dist/providers.d.ts +25 -0
  22. package/dist/providers.js +415 -0
  23. package/dist/response.d.ts +17 -0
  24. package/dist/response.js +105 -0
  25. package/dist/runtime.d.ts +39 -0
  26. package/dist/runtime.js +130 -0
  27. package/dist/schemas.d.ts +758 -0
  28. package/dist/schemas.js +244 -0
  29. package/dist/settings-write.d.ts +9 -0
  30. package/dist/settings-write.js +77 -0
  31. package/dist/settings.d.ts +8 -0
  32. package/dist/settings.js +99 -0
  33. package/dist/tool-contracts.d.ts +343 -0
  34. package/dist/tool-contracts.js +10 -0
  35. package/package.json +83 -4
  36. package/src/errors.ts +52 -0
  37. package/src/execute.ts +300 -0
  38. package/src/extension.ts +210 -0
  39. package/src/index.ts +36 -0
  40. package/src/local-runtime.ts +273 -0
  41. package/src/mcp-cli.ts +52 -0
  42. package/src/mcp-server.ts +187 -0
  43. package/src/provider-http.ts +67 -0
  44. package/src/provider-types.ts +33 -0
  45. package/src/providers.ts +517 -0
  46. package/src/response.ts +125 -0
  47. package/src/runtime.ts +184 -0
  48. package/src/schemas.ts +368 -0
  49. package/src/settings-write.ts +96 -0
  50. package/src/settings.ts +119 -0
  51. package/src/tool-contracts.ts +22 -0
@@ -0,0 +1,758 @@
1
+ /**
2
+ * Authoritative public schemas for pi-embeddings.
3
+ *
4
+ * Types across the library, Pi extension and MCP server derive from this file. The descriptor shape
5
+ * deliberately matches the stored HighSKU vector space document, so legacy vectors remain compatible
6
+ * without rewriting stored bytes or inventing unknown provenance.
7
+ */
8
+ import { Type, type Static } from 'typebox';
9
+ export declare const EMBEDDINGS_SETTINGS_KEY = "pi-embeddings";
10
+ export declare const EMBEDDINGS_PROTOCOL_VERSION = 2;
11
+ export declare const EMBEDDING_FORMAT_VERSION = "host-display-attributes-v1";
12
+ export declare const EMBEDDING_DOCUMENT_PREFIX = "title: none | text: ";
13
+ export declare const EMBEDDING_NORMALIZATION_VERSION = "finite-nonzero-l2-v1";
14
+ export declare const EMBEDDING_CONTEXT_META_KEY = "pi-embeddings/context";
15
+ export declare const EMBEDDING_ROUTE_IDS: readonly ["local", "openai", "sarvam", "gateway", "openrouter", "cloudflare"];
16
+ export type EmbeddingRouteId = (typeof EMBEDDING_ROUTE_IDS)[number];
17
+ export declare const GATEWAY_EMBEDDING_MODELS: readonly ["text-embedding-3-small", "openai/text-embedding-3-small"];
18
+ export declare const OPENROUTER_EMBEDDING_MODELS: readonly ["openai/text-embedding-3-small"];
19
+ export declare const CLOUDFLARE_EMBEDDING_MODELS: readonly ["@cf/baai/bge-base-en-v1.5"];
20
+ export declare const EMBEDDING_ERROR_CODES: readonly ["configuration-invalid", "route-unconfigured", "missing-credentials", "http-auth", "http-not-found", "http-rate-limit", "http-forbidden", "http-bad-request", "http-server-error", "transport-failed", "provider-response-invalid", "provider-response-mismatch", "vector-invalid", "vector-zero", "input-empty", "input-too-long", "tokenizer-roundtrip-failed", "attribution-unavailable", "local-resources-unavailable", "local-model-mismatch", "local-runtime-mismatch", "local-startup-failed", "local-cpu-startup-invalid", "cancelled", "unstarted"];
21
+ export type EmbeddingErrorCode = (typeof EMBEDDING_ERROR_CODES)[number];
22
+ export declare const embeddingRouteSchema: Type.TObject<{
23
+ provider: Type.TUnion<[Type.TLiteral<"local">, Type.TLiteral<"openai">, Type.TLiteral<"sarvam">, Type.TLiteral<"gateway">, Type.TLiteral<"openrouter">, Type.TLiteral<"cloudflare">]>;
24
+ model: Type.TString;
25
+ }>;
26
+ /**
27
+ * Complete generating-space identity. `provider` is canonical: the gateway route deliberately
28
+ * reports the OpenAI recipe it declares, not its transport alias.
29
+ */
30
+ export declare const embeddingSpaceSchema: Type.TUnion<[Type.TObject<{
31
+ provider: Type.TLiteral<"local">;
32
+ model: Type.TLiteral<"embeddinggemma-2">;
33
+ revision: Type.TString;
34
+ quantization: Type.TLiteral<"Q8_0">;
35
+ runtime: Type.TString;
36
+ dimensions: Type.TLiteral<768>;
37
+ format: Type.TLiteral<"host-display-attributes-v1">;
38
+ prefix: Type.TLiteral<"title: none | text: ">;
39
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
40
+ }>, Type.TObject<{
41
+ provider: Type.TLiteral<"openai">;
42
+ model: Type.TLiteral<"text-embedding-3-small">;
43
+ revision: Type.TNull;
44
+ quantization: Type.TNull;
45
+ runtime: Type.TNull;
46
+ dimensions: Type.TLiteral<1536>;
47
+ format: Type.TLiteral<"host-display-attributes-v1">;
48
+ prefix: Type.TLiteral<"title: none | text: ">;
49
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
50
+ }>, Type.TObject<{
51
+ provider: Type.TLiteral<"sarvam">;
52
+ model: Type.TLiteral<"embeddinggemma-2">;
53
+ revision: Type.TNull;
54
+ quantization: Type.TNull;
55
+ runtime: Type.TLiteral<"sarvam-v2">;
56
+ dimensions: Type.TLiteral<768>;
57
+ format: Type.TLiteral<"host-display-attributes-v1">;
58
+ prefix: Type.TLiteral<"title: none | text: ">;
59
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
60
+ }>, Type.TObject<{
61
+ provider: Type.TLiteral<"cloudflare">;
62
+ model: Type.TLiteral<"@cf/baai/bge-base-en-v1.5">;
63
+ revision: Type.TNull;
64
+ quantization: Type.TNull;
65
+ runtime: Type.TLiteral<"cloudflare-workers-ai">;
66
+ dimensions: Type.TLiteral<768>;
67
+ pooling: Type.TUnion<[Type.TLiteral<"mean">, Type.TLiteral<"cls">]>;
68
+ format: Type.TLiteral<"host-display-attributes-v1">;
69
+ prefix: Type.TLiteral<"title: none | text: ">;
70
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
71
+ }>]>;
72
+ export declare const embeddingSettingsSchema: Type.TObject<{
73
+ version: Type.TOptional<Type.TLiteral<1>>;
74
+ default: Type.TObject<{
75
+ provider: Type.TUnion<[Type.TLiteral<"local">, Type.TLiteral<"openai">, Type.TLiteral<"sarvam">, Type.TLiteral<"gateway">, Type.TLiteral<"openrouter">, Type.TLiteral<"cloudflare">]>;
76
+ model: Type.TString;
77
+ }>;
78
+ fallback: Type.TOptional<Type.TArray<Type.TObject<{
79
+ provider: Type.TUnion<[Type.TLiteral<"local">, Type.TLiteral<"openai">, Type.TLiteral<"sarvam">, Type.TLiteral<"gateway">, Type.TLiteral<"openrouter">, Type.TLiteral<"cloudflare">]>;
80
+ model: Type.TString;
81
+ }>>>;
82
+ compare: Type.TOptional<Type.TArray<Type.TObject<{
83
+ provider: Type.TUnion<[Type.TLiteral<"local">, Type.TLiteral<"openai">, Type.TLiteral<"sarvam">, Type.TLiteral<"gateway">, Type.TLiteral<"openrouter">, Type.TLiteral<"cloudflare">]>;
84
+ model: Type.TString;
85
+ }>>>;
86
+ providers: Type.TOptional<Type.TObject<{
87
+ local: Type.TOptional<Type.TObject<{
88
+ executable: Type.TString;
89
+ modelPath: Type.TString;
90
+ port: Type.TOptional<Type.TInteger>;
91
+ }>>;
92
+ openai: Type.TOptional<Type.TObject<{
93
+ apiKey: Type.TOptional<Type.TString>;
94
+ }>>;
95
+ sarvam: Type.TOptional<Type.TObject<{
96
+ apiKey: Type.TOptional<Type.TString>;
97
+ }>>;
98
+ gateway: Type.TOptional<Type.TObject<{
99
+ baseUrl: Type.TString;
100
+ apiKey: Type.TString;
101
+ model: Type.TUnion<[Type.TLiteral<"text-embedding-3-small">, Type.TLiteral<"openai/text-embedding-3-small">]>;
102
+ stage: Type.TUnion<[Type.TLiteral<"dev">, Type.TLiteral<"prod">]>;
103
+ }>>;
104
+ openrouter: Type.TOptional<Type.TObject<{
105
+ apiKey: Type.TOptional<Type.TString>;
106
+ }>>;
107
+ cloudflare: Type.TOptional<Type.TObject<{
108
+ accountId: Type.TOptional<Type.TString>;
109
+ apiKey: Type.TOptional<Type.TString>;
110
+ gatewayId: Type.TOptional<Type.TString>;
111
+ model: Type.TOptional<Type.TLiteral<"@cf/baai/bge-base-en-v1.5">>;
112
+ pooling: Type.TOptional<Type.TUnion<[Type.TLiteral<"mean">, Type.TLiteral<"cls">]>>;
113
+ }>>;
114
+ }>>;
115
+ }>;
116
+ export declare const embeddingRequestSchema: Type.TObject<{
117
+ inputs: Type.TArray<Type.TString>;
118
+ }>;
119
+ /** Generic, host-owned attribution. It is never a model argument or proof of ownership. */
120
+ export declare const embeddingContextSchema: Type.TObject<{
121
+ endUser: Type.TString;
122
+ tags: Type.TArray<Type.TString>;
123
+ }>;
124
+ export declare const embeddingUsageSchema: Type.TObject<{
125
+ providerReportedInputTokens: Type.TUnion<[Type.TInteger, Type.TNull]>;
126
+ preparedInputTokens: Type.TUnion<[Type.TInteger, Type.TNull]>;
127
+ billedTokens: Type.TUnion<[Type.TInteger, Type.TNull]>;
128
+ }>;
129
+ export declare const embeddingAttemptSchema: Type.TObject<{
130
+ id: Type.TString;
131
+ route: Type.TUnion<[Type.TLiteral<"local">, Type.TLiteral<"openai">, Type.TLiteral<"sarvam">, Type.TLiteral<"gateway">, Type.TLiteral<"openrouter">, Type.TLiteral<"cloudflare">]>;
132
+ model: Type.TString;
133
+ routeIndex: Type.TInteger;
134
+ status: Type.TUnion<[Type.TLiteral<"success">, Type.TLiteral<"error">, Type.TLiteral<"cancelled">]>;
135
+ usage: Type.TUnion<[Type.TObject<{
136
+ providerReportedInputTokens: Type.TUnion<[Type.TInteger, Type.TNull]>;
137
+ preparedInputTokens: Type.TUnion<[Type.TInteger, Type.TNull]>;
138
+ billedTokens: Type.TUnion<[Type.TInteger, Type.TNull]>;
139
+ }>, Type.TNull]>;
140
+ errorCode: Type.TOptional<Type.TUnion<[Type.TLiteral<"configuration-invalid">, Type.TLiteral<"route-unconfigured">, Type.TLiteral<"missing-credentials">, Type.TLiteral<"http-auth">, Type.TLiteral<"http-not-found">, Type.TLiteral<"http-rate-limit">, Type.TLiteral<"http-forbidden">, Type.TLiteral<"http-bad-request">, Type.TLiteral<"http-server-error">, Type.TLiteral<"transport-failed">, Type.TLiteral<"provider-response-invalid">, Type.TLiteral<"provider-response-mismatch">, Type.TLiteral<"vector-invalid">, Type.TLiteral<"vector-zero">, Type.TLiteral<"input-empty">, Type.TLiteral<"input-too-long">, Type.TLiteral<"tokenizer-roundtrip-failed">, Type.TLiteral<"attribution-unavailable">, Type.TLiteral<"local-resources-unavailable">, Type.TLiteral<"local-model-mismatch">, Type.TLiteral<"local-runtime-mismatch">, Type.TLiteral<"local-startup-failed">, Type.TLiteral<"local-cpu-startup-invalid">, Type.TLiteral<"cancelled">, Type.TLiteral<"unstarted">]>>;
141
+ }>;
142
+ export declare const embeddingOutcomeSchema: Type.TUnion<[Type.TObject<{
143
+ status: Type.TLiteral<"success">;
144
+ index: Type.TInteger;
145
+ vector: Type.TArray<Type.TNumber>;
146
+ route: Type.TUnion<[Type.TLiteral<"local">, Type.TLiteral<"openai">, Type.TLiteral<"sarvam">, Type.TLiteral<"gateway">, Type.TLiteral<"openrouter">, Type.TLiteral<"cloudflare">]>;
147
+ model: Type.TString;
148
+ space: Type.TUnion<[Type.TObject<{
149
+ provider: Type.TLiteral<"local">;
150
+ model: Type.TLiteral<"embeddinggemma-2">;
151
+ revision: Type.TString;
152
+ quantization: Type.TLiteral<"Q8_0">;
153
+ runtime: Type.TString;
154
+ dimensions: Type.TLiteral<768>;
155
+ format: Type.TLiteral<"host-display-attributes-v1">;
156
+ prefix: Type.TLiteral<"title: none | text: ">;
157
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
158
+ }>, Type.TObject<{
159
+ provider: Type.TLiteral<"openai">;
160
+ model: Type.TLiteral<"text-embedding-3-small">;
161
+ revision: Type.TNull;
162
+ quantization: Type.TNull;
163
+ runtime: Type.TNull;
164
+ dimensions: Type.TLiteral<1536>;
165
+ format: Type.TLiteral<"host-display-attributes-v1">;
166
+ prefix: Type.TLiteral<"title: none | text: ">;
167
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
168
+ }>, Type.TObject<{
169
+ provider: Type.TLiteral<"sarvam">;
170
+ model: Type.TLiteral<"embeddinggemma-2">;
171
+ revision: Type.TNull;
172
+ quantization: Type.TNull;
173
+ runtime: Type.TLiteral<"sarvam-v2">;
174
+ dimensions: Type.TLiteral<768>;
175
+ format: Type.TLiteral<"host-display-attributes-v1">;
176
+ prefix: Type.TLiteral<"title: none | text: ">;
177
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
178
+ }>, Type.TObject<{
179
+ provider: Type.TLiteral<"cloudflare">;
180
+ model: Type.TLiteral<"@cf/baai/bge-base-en-v1.5">;
181
+ revision: Type.TNull;
182
+ quantization: Type.TNull;
183
+ runtime: Type.TLiteral<"cloudflare-workers-ai">;
184
+ dimensions: Type.TLiteral<768>;
185
+ pooling: Type.TUnion<[Type.TLiteral<"mean">, Type.TLiteral<"cls">]>;
186
+ format: Type.TLiteral<"host-display-attributes-v1">;
187
+ prefix: Type.TLiteral<"title: none | text: ">;
188
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
189
+ }>]>;
190
+ attemptId: Type.TString;
191
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
192
+ }>, Type.TObject<{
193
+ status: Type.TLiteral<"error">;
194
+ index: Type.TInteger;
195
+ code: Type.TUnion<[Type.TLiteral<"configuration-invalid">, Type.TLiteral<"route-unconfigured">, Type.TLiteral<"missing-credentials">, Type.TLiteral<"http-auth">, Type.TLiteral<"http-not-found">, Type.TLiteral<"http-rate-limit">, Type.TLiteral<"http-forbidden">, Type.TLiteral<"http-bad-request">, Type.TLiteral<"http-server-error">, Type.TLiteral<"transport-failed">, Type.TLiteral<"provider-response-invalid">, Type.TLiteral<"provider-response-mismatch">, Type.TLiteral<"vector-invalid">, Type.TLiteral<"vector-zero">, Type.TLiteral<"input-empty">, Type.TLiteral<"input-too-long">, Type.TLiteral<"tokenizer-roundtrip-failed">, Type.TLiteral<"attribution-unavailable">, Type.TLiteral<"local-resources-unavailable">, Type.TLiteral<"local-model-mismatch">, Type.TLiteral<"local-runtime-mismatch">, Type.TLiteral<"local-startup-failed">, Type.TLiteral<"local-cpu-startup-invalid">, Type.TLiteral<"cancelled">, Type.TLiteral<"unstarted">]>;
196
+ attemptId: Type.TUnion<[Type.TString, Type.TNull]>;
197
+ }>]>;
198
+ /**
199
+ * Actual generating identity observed on successful outcomes. `generations` is the complete set;
200
+ * the singular fields are populated only when every successful vector came from one generation.
201
+ */
202
+ export declare const embeddingGenerationSchema: Type.TObject<{
203
+ provider: Type.TUnion<[Type.TLiteral<"local">, Type.TLiteral<"openai">, Type.TLiteral<"sarvam">, Type.TLiteral<"gateway">, Type.TLiteral<"openrouter">, Type.TLiteral<"cloudflare">]>;
204
+ model: Type.TString;
205
+ space: Type.TUnion<[Type.TObject<{
206
+ provider: Type.TLiteral<"local">;
207
+ model: Type.TLiteral<"embeddinggemma-2">;
208
+ revision: Type.TString;
209
+ quantization: Type.TLiteral<"Q8_0">;
210
+ runtime: Type.TString;
211
+ dimensions: Type.TLiteral<768>;
212
+ format: Type.TLiteral<"host-display-attributes-v1">;
213
+ prefix: Type.TLiteral<"title: none | text: ">;
214
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
215
+ }>, Type.TObject<{
216
+ provider: Type.TLiteral<"openai">;
217
+ model: Type.TLiteral<"text-embedding-3-small">;
218
+ revision: Type.TNull;
219
+ quantization: Type.TNull;
220
+ runtime: Type.TNull;
221
+ dimensions: Type.TLiteral<1536>;
222
+ format: Type.TLiteral<"host-display-attributes-v1">;
223
+ prefix: Type.TLiteral<"title: none | text: ">;
224
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
225
+ }>, Type.TObject<{
226
+ provider: Type.TLiteral<"sarvam">;
227
+ model: Type.TLiteral<"embeddinggemma-2">;
228
+ revision: Type.TNull;
229
+ quantization: Type.TNull;
230
+ runtime: Type.TLiteral<"sarvam-v2">;
231
+ dimensions: Type.TLiteral<768>;
232
+ format: Type.TLiteral<"host-display-attributes-v1">;
233
+ prefix: Type.TLiteral<"title: none | text: ">;
234
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
235
+ }>, Type.TObject<{
236
+ provider: Type.TLiteral<"cloudflare">;
237
+ model: Type.TLiteral<"@cf/baai/bge-base-en-v1.5">;
238
+ revision: Type.TNull;
239
+ quantization: Type.TNull;
240
+ runtime: Type.TLiteral<"cloudflare-workers-ai">;
241
+ dimensions: Type.TLiteral<768>;
242
+ pooling: Type.TUnion<[Type.TLiteral<"mean">, Type.TLiteral<"cls">]>;
243
+ format: Type.TLiteral<"host-display-attributes-v1">;
244
+ prefix: Type.TLiteral<"title: none | text: ">;
245
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
246
+ }>]>;
247
+ }>;
248
+ export declare const embeddingResultSchema: Type.TObject<{
249
+ schemaVersion: Type.TLiteral<2>;
250
+ provider: Type.TUnion<[Type.TUnion<[Type.TLiteral<"local">, Type.TLiteral<"openai">, Type.TLiteral<"sarvam">, Type.TLiteral<"gateway">, Type.TLiteral<"openrouter">, Type.TLiteral<"cloudflare">]>, Type.TNull]>;
251
+ model: Type.TUnion<[Type.TString, Type.TNull]>;
252
+ space: Type.TUnion<[Type.TUnion<[Type.TObject<{
253
+ provider: Type.TLiteral<"local">;
254
+ model: Type.TLiteral<"embeddinggemma-2">;
255
+ revision: Type.TString;
256
+ quantization: Type.TLiteral<"Q8_0">;
257
+ runtime: Type.TString;
258
+ dimensions: Type.TLiteral<768>;
259
+ format: Type.TLiteral<"host-display-attributes-v1">;
260
+ prefix: Type.TLiteral<"title: none | text: ">;
261
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
262
+ }>, Type.TObject<{
263
+ provider: Type.TLiteral<"openai">;
264
+ model: Type.TLiteral<"text-embedding-3-small">;
265
+ revision: Type.TNull;
266
+ quantization: Type.TNull;
267
+ runtime: Type.TNull;
268
+ dimensions: Type.TLiteral<1536>;
269
+ format: Type.TLiteral<"host-display-attributes-v1">;
270
+ prefix: Type.TLiteral<"title: none | text: ">;
271
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
272
+ }>, Type.TObject<{
273
+ provider: Type.TLiteral<"sarvam">;
274
+ model: Type.TLiteral<"embeddinggemma-2">;
275
+ revision: Type.TNull;
276
+ quantization: Type.TNull;
277
+ runtime: Type.TLiteral<"sarvam-v2">;
278
+ dimensions: Type.TLiteral<768>;
279
+ format: Type.TLiteral<"host-display-attributes-v1">;
280
+ prefix: Type.TLiteral<"title: none | text: ">;
281
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
282
+ }>, Type.TObject<{
283
+ provider: Type.TLiteral<"cloudflare">;
284
+ model: Type.TLiteral<"@cf/baai/bge-base-en-v1.5">;
285
+ revision: Type.TNull;
286
+ quantization: Type.TNull;
287
+ runtime: Type.TLiteral<"cloudflare-workers-ai">;
288
+ dimensions: Type.TLiteral<768>;
289
+ pooling: Type.TUnion<[Type.TLiteral<"mean">, Type.TLiteral<"cls">]>;
290
+ format: Type.TLiteral<"host-display-attributes-v1">;
291
+ prefix: Type.TLiteral<"title: none | text: ">;
292
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
293
+ }>]>, Type.TNull]>;
294
+ generations: Type.TArray<Type.TObject<{
295
+ provider: Type.TUnion<[Type.TLiteral<"local">, Type.TLiteral<"openai">, Type.TLiteral<"sarvam">, Type.TLiteral<"gateway">, Type.TLiteral<"openrouter">, Type.TLiteral<"cloudflare">]>;
296
+ model: Type.TString;
297
+ space: Type.TUnion<[Type.TObject<{
298
+ provider: Type.TLiteral<"local">;
299
+ model: Type.TLiteral<"embeddinggemma-2">;
300
+ revision: Type.TString;
301
+ quantization: Type.TLiteral<"Q8_0">;
302
+ runtime: Type.TString;
303
+ dimensions: Type.TLiteral<768>;
304
+ format: Type.TLiteral<"host-display-attributes-v1">;
305
+ prefix: Type.TLiteral<"title: none | text: ">;
306
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
307
+ }>, Type.TObject<{
308
+ provider: Type.TLiteral<"openai">;
309
+ model: Type.TLiteral<"text-embedding-3-small">;
310
+ revision: Type.TNull;
311
+ quantization: Type.TNull;
312
+ runtime: Type.TNull;
313
+ dimensions: Type.TLiteral<1536>;
314
+ format: Type.TLiteral<"host-display-attributes-v1">;
315
+ prefix: Type.TLiteral<"title: none | text: ">;
316
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
317
+ }>, Type.TObject<{
318
+ provider: Type.TLiteral<"sarvam">;
319
+ model: Type.TLiteral<"embeddinggemma-2">;
320
+ revision: Type.TNull;
321
+ quantization: Type.TNull;
322
+ runtime: Type.TLiteral<"sarvam-v2">;
323
+ dimensions: Type.TLiteral<768>;
324
+ format: Type.TLiteral<"host-display-attributes-v1">;
325
+ prefix: Type.TLiteral<"title: none | text: ">;
326
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
327
+ }>, Type.TObject<{
328
+ provider: Type.TLiteral<"cloudflare">;
329
+ model: Type.TLiteral<"@cf/baai/bge-base-en-v1.5">;
330
+ revision: Type.TNull;
331
+ quantization: Type.TNull;
332
+ runtime: Type.TLiteral<"cloudflare-workers-ai">;
333
+ dimensions: Type.TLiteral<768>;
334
+ pooling: Type.TUnion<[Type.TLiteral<"mean">, Type.TLiteral<"cls">]>;
335
+ format: Type.TLiteral<"host-display-attributes-v1">;
336
+ prefix: Type.TLiteral<"title: none | text: ">;
337
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
338
+ }>]>;
339
+ }>>;
340
+ outcomes: Type.TArray<Type.TUnion<[Type.TObject<{
341
+ status: Type.TLiteral<"success">;
342
+ index: Type.TInteger;
343
+ vector: Type.TArray<Type.TNumber>;
344
+ route: Type.TUnion<[Type.TLiteral<"local">, Type.TLiteral<"openai">, Type.TLiteral<"sarvam">, Type.TLiteral<"gateway">, Type.TLiteral<"openrouter">, Type.TLiteral<"cloudflare">]>;
345
+ model: Type.TString;
346
+ space: Type.TUnion<[Type.TObject<{
347
+ provider: Type.TLiteral<"local">;
348
+ model: Type.TLiteral<"embeddinggemma-2">;
349
+ revision: Type.TString;
350
+ quantization: Type.TLiteral<"Q8_0">;
351
+ runtime: Type.TString;
352
+ dimensions: Type.TLiteral<768>;
353
+ format: Type.TLiteral<"host-display-attributes-v1">;
354
+ prefix: Type.TLiteral<"title: none | text: ">;
355
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
356
+ }>, Type.TObject<{
357
+ provider: Type.TLiteral<"openai">;
358
+ model: Type.TLiteral<"text-embedding-3-small">;
359
+ revision: Type.TNull;
360
+ quantization: Type.TNull;
361
+ runtime: Type.TNull;
362
+ dimensions: Type.TLiteral<1536>;
363
+ format: Type.TLiteral<"host-display-attributes-v1">;
364
+ prefix: Type.TLiteral<"title: none | text: ">;
365
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
366
+ }>, Type.TObject<{
367
+ provider: Type.TLiteral<"sarvam">;
368
+ model: Type.TLiteral<"embeddinggemma-2">;
369
+ revision: Type.TNull;
370
+ quantization: Type.TNull;
371
+ runtime: Type.TLiteral<"sarvam-v2">;
372
+ dimensions: Type.TLiteral<768>;
373
+ format: Type.TLiteral<"host-display-attributes-v1">;
374
+ prefix: Type.TLiteral<"title: none | text: ">;
375
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
376
+ }>, Type.TObject<{
377
+ provider: Type.TLiteral<"cloudflare">;
378
+ model: Type.TLiteral<"@cf/baai/bge-base-en-v1.5">;
379
+ revision: Type.TNull;
380
+ quantization: Type.TNull;
381
+ runtime: Type.TLiteral<"cloudflare-workers-ai">;
382
+ dimensions: Type.TLiteral<768>;
383
+ pooling: Type.TUnion<[Type.TLiteral<"mean">, Type.TLiteral<"cls">]>;
384
+ format: Type.TLiteral<"host-display-attributes-v1">;
385
+ prefix: Type.TLiteral<"title: none | text: ">;
386
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
387
+ }>]>;
388
+ attemptId: Type.TString;
389
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
390
+ }>, Type.TObject<{
391
+ status: Type.TLiteral<"error">;
392
+ index: Type.TInteger;
393
+ code: Type.TUnion<[Type.TLiteral<"configuration-invalid">, Type.TLiteral<"route-unconfigured">, Type.TLiteral<"missing-credentials">, Type.TLiteral<"http-auth">, Type.TLiteral<"http-not-found">, Type.TLiteral<"http-rate-limit">, Type.TLiteral<"http-forbidden">, Type.TLiteral<"http-bad-request">, Type.TLiteral<"http-server-error">, Type.TLiteral<"transport-failed">, Type.TLiteral<"provider-response-invalid">, Type.TLiteral<"provider-response-mismatch">, Type.TLiteral<"vector-invalid">, Type.TLiteral<"vector-zero">, Type.TLiteral<"input-empty">, Type.TLiteral<"input-too-long">, Type.TLiteral<"tokenizer-roundtrip-failed">, Type.TLiteral<"attribution-unavailable">, Type.TLiteral<"local-resources-unavailable">, Type.TLiteral<"local-model-mismatch">, Type.TLiteral<"local-runtime-mismatch">, Type.TLiteral<"local-startup-failed">, Type.TLiteral<"local-cpu-startup-invalid">, Type.TLiteral<"cancelled">, Type.TLiteral<"unstarted">]>;
394
+ attemptId: Type.TUnion<[Type.TString, Type.TNull]>;
395
+ }>]>>;
396
+ attempts: Type.TArray<Type.TObject<{
397
+ id: Type.TString;
398
+ route: Type.TUnion<[Type.TLiteral<"local">, Type.TLiteral<"openai">, Type.TLiteral<"sarvam">, Type.TLiteral<"gateway">, Type.TLiteral<"openrouter">, Type.TLiteral<"cloudflare">]>;
399
+ model: Type.TString;
400
+ routeIndex: Type.TInteger;
401
+ status: Type.TUnion<[Type.TLiteral<"success">, Type.TLiteral<"error">, Type.TLiteral<"cancelled">]>;
402
+ usage: Type.TUnion<[Type.TObject<{
403
+ providerReportedInputTokens: Type.TUnion<[Type.TInteger, Type.TNull]>;
404
+ preparedInputTokens: Type.TUnion<[Type.TInteger, Type.TNull]>;
405
+ billedTokens: Type.TUnion<[Type.TInteger, Type.TNull]>;
406
+ }>, Type.TNull]>;
407
+ errorCode: Type.TOptional<Type.TUnion<[Type.TLiteral<"configuration-invalid">, Type.TLiteral<"route-unconfigured">, Type.TLiteral<"missing-credentials">, Type.TLiteral<"http-auth">, Type.TLiteral<"http-not-found">, Type.TLiteral<"http-rate-limit">, Type.TLiteral<"http-forbidden">, Type.TLiteral<"http-bad-request">, Type.TLiteral<"http-server-error">, Type.TLiteral<"transport-failed">, Type.TLiteral<"provider-response-invalid">, Type.TLiteral<"provider-response-mismatch">, Type.TLiteral<"vector-invalid">, Type.TLiteral<"vector-zero">, Type.TLiteral<"input-empty">, Type.TLiteral<"input-too-long">, Type.TLiteral<"tokenizer-roundtrip-failed">, Type.TLiteral<"attribution-unavailable">, Type.TLiteral<"local-resources-unavailable">, Type.TLiteral<"local-model-mismatch">, Type.TLiteral<"local-runtime-mismatch">, Type.TLiteral<"local-startup-failed">, Type.TLiteral<"local-cpu-startup-invalid">, Type.TLiteral<"cancelled">, Type.TLiteral<"unstarted">]>>;
408
+ }>>;
409
+ }>;
410
+ export declare const embeddingCompareEntrySchema: Type.TObject<{
411
+ route: Type.TUnion<[Type.TLiteral<"local">, Type.TLiteral<"openai">, Type.TLiteral<"sarvam">, Type.TLiteral<"gateway">, Type.TLiteral<"openrouter">, Type.TLiteral<"cloudflare">]>;
412
+ model: Type.TString;
413
+ status: Type.TUnion<[Type.TLiteral<"success">, Type.TLiteral<"error">, Type.TLiteral<"cancelled">]>;
414
+ result: Type.TObject<{
415
+ schemaVersion: Type.TLiteral<2>;
416
+ provider: Type.TUnion<[Type.TUnion<[Type.TLiteral<"local">, Type.TLiteral<"openai">, Type.TLiteral<"sarvam">, Type.TLiteral<"gateway">, Type.TLiteral<"openrouter">, Type.TLiteral<"cloudflare">]>, Type.TNull]>;
417
+ model: Type.TUnion<[Type.TString, Type.TNull]>;
418
+ space: Type.TUnion<[Type.TUnion<[Type.TObject<{
419
+ provider: Type.TLiteral<"local">;
420
+ model: Type.TLiteral<"embeddinggemma-2">;
421
+ revision: Type.TString;
422
+ quantization: Type.TLiteral<"Q8_0">;
423
+ runtime: Type.TString;
424
+ dimensions: Type.TLiteral<768>;
425
+ format: Type.TLiteral<"host-display-attributes-v1">;
426
+ prefix: Type.TLiteral<"title: none | text: ">;
427
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
428
+ }>, Type.TObject<{
429
+ provider: Type.TLiteral<"openai">;
430
+ model: Type.TLiteral<"text-embedding-3-small">;
431
+ revision: Type.TNull;
432
+ quantization: Type.TNull;
433
+ runtime: Type.TNull;
434
+ dimensions: Type.TLiteral<1536>;
435
+ format: Type.TLiteral<"host-display-attributes-v1">;
436
+ prefix: Type.TLiteral<"title: none | text: ">;
437
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
438
+ }>, Type.TObject<{
439
+ provider: Type.TLiteral<"sarvam">;
440
+ model: Type.TLiteral<"embeddinggemma-2">;
441
+ revision: Type.TNull;
442
+ quantization: Type.TNull;
443
+ runtime: Type.TLiteral<"sarvam-v2">;
444
+ dimensions: Type.TLiteral<768>;
445
+ format: Type.TLiteral<"host-display-attributes-v1">;
446
+ prefix: Type.TLiteral<"title: none | text: ">;
447
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
448
+ }>, Type.TObject<{
449
+ provider: Type.TLiteral<"cloudflare">;
450
+ model: Type.TLiteral<"@cf/baai/bge-base-en-v1.5">;
451
+ revision: Type.TNull;
452
+ quantization: Type.TNull;
453
+ runtime: Type.TLiteral<"cloudflare-workers-ai">;
454
+ dimensions: Type.TLiteral<768>;
455
+ pooling: Type.TUnion<[Type.TLiteral<"mean">, Type.TLiteral<"cls">]>;
456
+ format: Type.TLiteral<"host-display-attributes-v1">;
457
+ prefix: Type.TLiteral<"title: none | text: ">;
458
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
459
+ }>]>, Type.TNull]>;
460
+ generations: Type.TArray<Type.TObject<{
461
+ provider: Type.TUnion<[Type.TLiteral<"local">, Type.TLiteral<"openai">, Type.TLiteral<"sarvam">, Type.TLiteral<"gateway">, Type.TLiteral<"openrouter">, Type.TLiteral<"cloudflare">]>;
462
+ model: Type.TString;
463
+ space: Type.TUnion<[Type.TObject<{
464
+ provider: Type.TLiteral<"local">;
465
+ model: Type.TLiteral<"embeddinggemma-2">;
466
+ revision: Type.TString;
467
+ quantization: Type.TLiteral<"Q8_0">;
468
+ runtime: Type.TString;
469
+ dimensions: Type.TLiteral<768>;
470
+ format: Type.TLiteral<"host-display-attributes-v1">;
471
+ prefix: Type.TLiteral<"title: none | text: ">;
472
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
473
+ }>, Type.TObject<{
474
+ provider: Type.TLiteral<"openai">;
475
+ model: Type.TLiteral<"text-embedding-3-small">;
476
+ revision: Type.TNull;
477
+ quantization: Type.TNull;
478
+ runtime: Type.TNull;
479
+ dimensions: Type.TLiteral<1536>;
480
+ format: Type.TLiteral<"host-display-attributes-v1">;
481
+ prefix: Type.TLiteral<"title: none | text: ">;
482
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
483
+ }>, Type.TObject<{
484
+ provider: Type.TLiteral<"sarvam">;
485
+ model: Type.TLiteral<"embeddinggemma-2">;
486
+ revision: Type.TNull;
487
+ quantization: Type.TNull;
488
+ runtime: Type.TLiteral<"sarvam-v2">;
489
+ dimensions: Type.TLiteral<768>;
490
+ format: Type.TLiteral<"host-display-attributes-v1">;
491
+ prefix: Type.TLiteral<"title: none | text: ">;
492
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
493
+ }>, Type.TObject<{
494
+ provider: Type.TLiteral<"cloudflare">;
495
+ model: Type.TLiteral<"@cf/baai/bge-base-en-v1.5">;
496
+ revision: Type.TNull;
497
+ quantization: Type.TNull;
498
+ runtime: Type.TLiteral<"cloudflare-workers-ai">;
499
+ dimensions: Type.TLiteral<768>;
500
+ pooling: Type.TUnion<[Type.TLiteral<"mean">, Type.TLiteral<"cls">]>;
501
+ format: Type.TLiteral<"host-display-attributes-v1">;
502
+ prefix: Type.TLiteral<"title: none | text: ">;
503
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
504
+ }>]>;
505
+ }>>;
506
+ outcomes: Type.TArray<Type.TUnion<[Type.TObject<{
507
+ status: Type.TLiteral<"success">;
508
+ index: Type.TInteger;
509
+ vector: Type.TArray<Type.TNumber>;
510
+ route: Type.TUnion<[Type.TLiteral<"local">, Type.TLiteral<"openai">, Type.TLiteral<"sarvam">, Type.TLiteral<"gateway">, Type.TLiteral<"openrouter">, Type.TLiteral<"cloudflare">]>;
511
+ model: Type.TString;
512
+ space: Type.TUnion<[Type.TObject<{
513
+ provider: Type.TLiteral<"local">;
514
+ model: Type.TLiteral<"embeddinggemma-2">;
515
+ revision: Type.TString;
516
+ quantization: Type.TLiteral<"Q8_0">;
517
+ runtime: Type.TString;
518
+ dimensions: Type.TLiteral<768>;
519
+ format: Type.TLiteral<"host-display-attributes-v1">;
520
+ prefix: Type.TLiteral<"title: none | text: ">;
521
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
522
+ }>, Type.TObject<{
523
+ provider: Type.TLiteral<"openai">;
524
+ model: Type.TLiteral<"text-embedding-3-small">;
525
+ revision: Type.TNull;
526
+ quantization: Type.TNull;
527
+ runtime: Type.TNull;
528
+ dimensions: Type.TLiteral<1536>;
529
+ format: Type.TLiteral<"host-display-attributes-v1">;
530
+ prefix: Type.TLiteral<"title: none | text: ">;
531
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
532
+ }>, Type.TObject<{
533
+ provider: Type.TLiteral<"sarvam">;
534
+ model: Type.TLiteral<"embeddinggemma-2">;
535
+ revision: Type.TNull;
536
+ quantization: Type.TNull;
537
+ runtime: Type.TLiteral<"sarvam-v2">;
538
+ dimensions: Type.TLiteral<768>;
539
+ format: Type.TLiteral<"host-display-attributes-v1">;
540
+ prefix: Type.TLiteral<"title: none | text: ">;
541
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
542
+ }>, Type.TObject<{
543
+ provider: Type.TLiteral<"cloudflare">;
544
+ model: Type.TLiteral<"@cf/baai/bge-base-en-v1.5">;
545
+ revision: Type.TNull;
546
+ quantization: Type.TNull;
547
+ runtime: Type.TLiteral<"cloudflare-workers-ai">;
548
+ dimensions: Type.TLiteral<768>;
549
+ pooling: Type.TUnion<[Type.TLiteral<"mean">, Type.TLiteral<"cls">]>;
550
+ format: Type.TLiteral<"host-display-attributes-v1">;
551
+ prefix: Type.TLiteral<"title: none | text: ">;
552
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
553
+ }>]>;
554
+ attemptId: Type.TString;
555
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
556
+ }>, Type.TObject<{
557
+ status: Type.TLiteral<"error">;
558
+ index: Type.TInteger;
559
+ code: Type.TUnion<[Type.TLiteral<"configuration-invalid">, Type.TLiteral<"route-unconfigured">, Type.TLiteral<"missing-credentials">, Type.TLiteral<"http-auth">, Type.TLiteral<"http-not-found">, Type.TLiteral<"http-rate-limit">, Type.TLiteral<"http-forbidden">, Type.TLiteral<"http-bad-request">, Type.TLiteral<"http-server-error">, Type.TLiteral<"transport-failed">, Type.TLiteral<"provider-response-invalid">, Type.TLiteral<"provider-response-mismatch">, Type.TLiteral<"vector-invalid">, Type.TLiteral<"vector-zero">, Type.TLiteral<"input-empty">, Type.TLiteral<"input-too-long">, Type.TLiteral<"tokenizer-roundtrip-failed">, Type.TLiteral<"attribution-unavailable">, Type.TLiteral<"local-resources-unavailable">, Type.TLiteral<"local-model-mismatch">, Type.TLiteral<"local-runtime-mismatch">, Type.TLiteral<"local-startup-failed">, Type.TLiteral<"local-cpu-startup-invalid">, Type.TLiteral<"cancelled">, Type.TLiteral<"unstarted">]>;
560
+ attemptId: Type.TUnion<[Type.TString, Type.TNull]>;
561
+ }>]>>;
562
+ attempts: Type.TArray<Type.TObject<{
563
+ id: Type.TString;
564
+ route: Type.TUnion<[Type.TLiteral<"local">, Type.TLiteral<"openai">, Type.TLiteral<"sarvam">, Type.TLiteral<"gateway">, Type.TLiteral<"openrouter">, Type.TLiteral<"cloudflare">]>;
565
+ model: Type.TString;
566
+ routeIndex: Type.TInteger;
567
+ status: Type.TUnion<[Type.TLiteral<"success">, Type.TLiteral<"error">, Type.TLiteral<"cancelled">]>;
568
+ usage: Type.TUnion<[Type.TObject<{
569
+ providerReportedInputTokens: Type.TUnion<[Type.TInteger, Type.TNull]>;
570
+ preparedInputTokens: Type.TUnion<[Type.TInteger, Type.TNull]>;
571
+ billedTokens: Type.TUnion<[Type.TInteger, Type.TNull]>;
572
+ }>, Type.TNull]>;
573
+ errorCode: Type.TOptional<Type.TUnion<[Type.TLiteral<"configuration-invalid">, Type.TLiteral<"route-unconfigured">, Type.TLiteral<"missing-credentials">, Type.TLiteral<"http-auth">, Type.TLiteral<"http-not-found">, Type.TLiteral<"http-rate-limit">, Type.TLiteral<"http-forbidden">, Type.TLiteral<"http-bad-request">, Type.TLiteral<"http-server-error">, Type.TLiteral<"transport-failed">, Type.TLiteral<"provider-response-invalid">, Type.TLiteral<"provider-response-mismatch">, Type.TLiteral<"vector-invalid">, Type.TLiteral<"vector-zero">, Type.TLiteral<"input-empty">, Type.TLiteral<"input-too-long">, Type.TLiteral<"tokenizer-roundtrip-failed">, Type.TLiteral<"attribution-unavailable">, Type.TLiteral<"local-resources-unavailable">, Type.TLiteral<"local-model-mismatch">, Type.TLiteral<"local-runtime-mismatch">, Type.TLiteral<"local-startup-failed">, Type.TLiteral<"local-cpu-startup-invalid">, Type.TLiteral<"cancelled">, Type.TLiteral<"unstarted">]>>;
574
+ }>>;
575
+ }>;
576
+ }>;
577
+ export declare const embeddingCompareResultSchema: Type.TObject<{
578
+ schemaVersion: Type.TLiteral<2>;
579
+ entries: Type.TArray<Type.TObject<{
580
+ route: Type.TUnion<[Type.TLiteral<"local">, Type.TLiteral<"openai">, Type.TLiteral<"sarvam">, Type.TLiteral<"gateway">, Type.TLiteral<"openrouter">, Type.TLiteral<"cloudflare">]>;
581
+ model: Type.TString;
582
+ status: Type.TUnion<[Type.TLiteral<"success">, Type.TLiteral<"error">, Type.TLiteral<"cancelled">]>;
583
+ result: Type.TObject<{
584
+ schemaVersion: Type.TLiteral<2>;
585
+ provider: Type.TUnion<[Type.TUnion<[Type.TLiteral<"local">, Type.TLiteral<"openai">, Type.TLiteral<"sarvam">, Type.TLiteral<"gateway">, Type.TLiteral<"openrouter">, Type.TLiteral<"cloudflare">]>, Type.TNull]>;
586
+ model: Type.TUnion<[Type.TString, Type.TNull]>;
587
+ space: Type.TUnion<[Type.TUnion<[Type.TObject<{
588
+ provider: Type.TLiteral<"local">;
589
+ model: Type.TLiteral<"embeddinggemma-2">;
590
+ revision: Type.TString;
591
+ quantization: Type.TLiteral<"Q8_0">;
592
+ runtime: Type.TString;
593
+ dimensions: Type.TLiteral<768>;
594
+ format: Type.TLiteral<"host-display-attributes-v1">;
595
+ prefix: Type.TLiteral<"title: none | text: ">;
596
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
597
+ }>, Type.TObject<{
598
+ provider: Type.TLiteral<"openai">;
599
+ model: Type.TLiteral<"text-embedding-3-small">;
600
+ revision: Type.TNull;
601
+ quantization: Type.TNull;
602
+ runtime: Type.TNull;
603
+ dimensions: Type.TLiteral<1536>;
604
+ format: Type.TLiteral<"host-display-attributes-v1">;
605
+ prefix: Type.TLiteral<"title: none | text: ">;
606
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
607
+ }>, Type.TObject<{
608
+ provider: Type.TLiteral<"sarvam">;
609
+ model: Type.TLiteral<"embeddinggemma-2">;
610
+ revision: Type.TNull;
611
+ quantization: Type.TNull;
612
+ runtime: Type.TLiteral<"sarvam-v2">;
613
+ dimensions: Type.TLiteral<768>;
614
+ format: Type.TLiteral<"host-display-attributes-v1">;
615
+ prefix: Type.TLiteral<"title: none | text: ">;
616
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
617
+ }>, Type.TObject<{
618
+ provider: Type.TLiteral<"cloudflare">;
619
+ model: Type.TLiteral<"@cf/baai/bge-base-en-v1.5">;
620
+ revision: Type.TNull;
621
+ quantization: Type.TNull;
622
+ runtime: Type.TLiteral<"cloudflare-workers-ai">;
623
+ dimensions: Type.TLiteral<768>;
624
+ pooling: Type.TUnion<[Type.TLiteral<"mean">, Type.TLiteral<"cls">]>;
625
+ format: Type.TLiteral<"host-display-attributes-v1">;
626
+ prefix: Type.TLiteral<"title: none | text: ">;
627
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
628
+ }>]>, Type.TNull]>;
629
+ generations: Type.TArray<Type.TObject<{
630
+ provider: Type.TUnion<[Type.TLiteral<"local">, Type.TLiteral<"openai">, Type.TLiteral<"sarvam">, Type.TLiteral<"gateway">, Type.TLiteral<"openrouter">, Type.TLiteral<"cloudflare">]>;
631
+ model: Type.TString;
632
+ space: Type.TUnion<[Type.TObject<{
633
+ provider: Type.TLiteral<"local">;
634
+ model: Type.TLiteral<"embeddinggemma-2">;
635
+ revision: Type.TString;
636
+ quantization: Type.TLiteral<"Q8_0">;
637
+ runtime: Type.TString;
638
+ dimensions: Type.TLiteral<768>;
639
+ format: Type.TLiteral<"host-display-attributes-v1">;
640
+ prefix: Type.TLiteral<"title: none | text: ">;
641
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
642
+ }>, Type.TObject<{
643
+ provider: Type.TLiteral<"openai">;
644
+ model: Type.TLiteral<"text-embedding-3-small">;
645
+ revision: Type.TNull;
646
+ quantization: Type.TNull;
647
+ runtime: Type.TNull;
648
+ dimensions: Type.TLiteral<1536>;
649
+ format: Type.TLiteral<"host-display-attributes-v1">;
650
+ prefix: Type.TLiteral<"title: none | text: ">;
651
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
652
+ }>, Type.TObject<{
653
+ provider: Type.TLiteral<"sarvam">;
654
+ model: Type.TLiteral<"embeddinggemma-2">;
655
+ revision: Type.TNull;
656
+ quantization: Type.TNull;
657
+ runtime: Type.TLiteral<"sarvam-v2">;
658
+ dimensions: Type.TLiteral<768>;
659
+ format: Type.TLiteral<"host-display-attributes-v1">;
660
+ prefix: Type.TLiteral<"title: none | text: ">;
661
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
662
+ }>, Type.TObject<{
663
+ provider: Type.TLiteral<"cloudflare">;
664
+ model: Type.TLiteral<"@cf/baai/bge-base-en-v1.5">;
665
+ revision: Type.TNull;
666
+ quantization: Type.TNull;
667
+ runtime: Type.TLiteral<"cloudflare-workers-ai">;
668
+ dimensions: Type.TLiteral<768>;
669
+ pooling: Type.TUnion<[Type.TLiteral<"mean">, Type.TLiteral<"cls">]>;
670
+ format: Type.TLiteral<"host-display-attributes-v1">;
671
+ prefix: Type.TLiteral<"title: none | text: ">;
672
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
673
+ }>]>;
674
+ }>>;
675
+ outcomes: Type.TArray<Type.TUnion<[Type.TObject<{
676
+ status: Type.TLiteral<"success">;
677
+ index: Type.TInteger;
678
+ vector: Type.TArray<Type.TNumber>;
679
+ route: Type.TUnion<[Type.TLiteral<"local">, Type.TLiteral<"openai">, Type.TLiteral<"sarvam">, Type.TLiteral<"gateway">, Type.TLiteral<"openrouter">, Type.TLiteral<"cloudflare">]>;
680
+ model: Type.TString;
681
+ space: Type.TUnion<[Type.TObject<{
682
+ provider: Type.TLiteral<"local">;
683
+ model: Type.TLiteral<"embeddinggemma-2">;
684
+ revision: Type.TString;
685
+ quantization: Type.TLiteral<"Q8_0">;
686
+ runtime: Type.TString;
687
+ dimensions: Type.TLiteral<768>;
688
+ format: Type.TLiteral<"host-display-attributes-v1">;
689
+ prefix: Type.TLiteral<"title: none | text: ">;
690
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
691
+ }>, Type.TObject<{
692
+ provider: Type.TLiteral<"openai">;
693
+ model: Type.TLiteral<"text-embedding-3-small">;
694
+ revision: Type.TNull;
695
+ quantization: Type.TNull;
696
+ runtime: Type.TNull;
697
+ dimensions: Type.TLiteral<1536>;
698
+ format: Type.TLiteral<"host-display-attributes-v1">;
699
+ prefix: Type.TLiteral<"title: none | text: ">;
700
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
701
+ }>, Type.TObject<{
702
+ provider: Type.TLiteral<"sarvam">;
703
+ model: Type.TLiteral<"embeddinggemma-2">;
704
+ revision: Type.TNull;
705
+ quantization: Type.TNull;
706
+ runtime: Type.TLiteral<"sarvam-v2">;
707
+ dimensions: Type.TLiteral<768>;
708
+ format: Type.TLiteral<"host-display-attributes-v1">;
709
+ prefix: Type.TLiteral<"title: none | text: ">;
710
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
711
+ }>, Type.TObject<{
712
+ provider: Type.TLiteral<"cloudflare">;
713
+ model: Type.TLiteral<"@cf/baai/bge-base-en-v1.5">;
714
+ revision: Type.TNull;
715
+ quantization: Type.TNull;
716
+ runtime: Type.TLiteral<"cloudflare-workers-ai">;
717
+ dimensions: Type.TLiteral<768>;
718
+ pooling: Type.TUnion<[Type.TLiteral<"mean">, Type.TLiteral<"cls">]>;
719
+ format: Type.TLiteral<"host-display-attributes-v1">;
720
+ prefix: Type.TLiteral<"title: none | text: ">;
721
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
722
+ }>]>;
723
+ attemptId: Type.TString;
724
+ normalization: Type.TLiteral<"finite-nonzero-l2-v1">;
725
+ }>, Type.TObject<{
726
+ status: Type.TLiteral<"error">;
727
+ index: Type.TInteger;
728
+ code: Type.TUnion<[Type.TLiteral<"configuration-invalid">, Type.TLiteral<"route-unconfigured">, Type.TLiteral<"missing-credentials">, Type.TLiteral<"http-auth">, Type.TLiteral<"http-not-found">, Type.TLiteral<"http-rate-limit">, Type.TLiteral<"http-forbidden">, Type.TLiteral<"http-bad-request">, Type.TLiteral<"http-server-error">, Type.TLiteral<"transport-failed">, Type.TLiteral<"provider-response-invalid">, Type.TLiteral<"provider-response-mismatch">, Type.TLiteral<"vector-invalid">, Type.TLiteral<"vector-zero">, Type.TLiteral<"input-empty">, Type.TLiteral<"input-too-long">, Type.TLiteral<"tokenizer-roundtrip-failed">, Type.TLiteral<"attribution-unavailable">, Type.TLiteral<"local-resources-unavailable">, Type.TLiteral<"local-model-mismatch">, Type.TLiteral<"local-runtime-mismatch">, Type.TLiteral<"local-startup-failed">, Type.TLiteral<"local-cpu-startup-invalid">, Type.TLiteral<"cancelled">, Type.TLiteral<"unstarted">]>;
729
+ attemptId: Type.TUnion<[Type.TString, Type.TNull]>;
730
+ }>]>>;
731
+ attempts: Type.TArray<Type.TObject<{
732
+ id: Type.TString;
733
+ route: Type.TUnion<[Type.TLiteral<"local">, Type.TLiteral<"openai">, Type.TLiteral<"sarvam">, Type.TLiteral<"gateway">, Type.TLiteral<"openrouter">, Type.TLiteral<"cloudflare">]>;
734
+ model: Type.TString;
735
+ routeIndex: Type.TInteger;
736
+ status: Type.TUnion<[Type.TLiteral<"success">, Type.TLiteral<"error">, Type.TLiteral<"cancelled">]>;
737
+ usage: Type.TUnion<[Type.TObject<{
738
+ providerReportedInputTokens: Type.TUnion<[Type.TInteger, Type.TNull]>;
739
+ preparedInputTokens: Type.TUnion<[Type.TInteger, Type.TNull]>;
740
+ billedTokens: Type.TUnion<[Type.TInteger, Type.TNull]>;
741
+ }>, Type.TNull]>;
742
+ errorCode: Type.TOptional<Type.TUnion<[Type.TLiteral<"configuration-invalid">, Type.TLiteral<"route-unconfigured">, Type.TLiteral<"missing-credentials">, Type.TLiteral<"http-auth">, Type.TLiteral<"http-not-found">, Type.TLiteral<"http-rate-limit">, Type.TLiteral<"http-forbidden">, Type.TLiteral<"http-bad-request">, Type.TLiteral<"http-server-error">, Type.TLiteral<"transport-failed">, Type.TLiteral<"provider-response-invalid">, Type.TLiteral<"provider-response-mismatch">, Type.TLiteral<"vector-invalid">, Type.TLiteral<"vector-zero">, Type.TLiteral<"input-empty">, Type.TLiteral<"input-too-long">, Type.TLiteral<"tokenizer-roundtrip-failed">, Type.TLiteral<"attribution-unavailable">, Type.TLiteral<"local-resources-unavailable">, Type.TLiteral<"local-model-mismatch">, Type.TLiteral<"local-runtime-mismatch">, Type.TLiteral<"local-startup-failed">, Type.TLiteral<"local-cpu-startup-invalid">, Type.TLiteral<"cancelled">, Type.TLiteral<"unstarted">]>>;
743
+ }>>;
744
+ }>;
745
+ }>>;
746
+ }>;
747
+ export type EmbeddingSettings = Static<typeof embeddingSettingsSchema>;
748
+ export type EmbeddingRoute = Static<typeof embeddingRouteSchema>;
749
+ export type EmbeddingSpace = Static<typeof embeddingSpaceSchema>;
750
+ export type EmbeddingRequest = Static<typeof embeddingRequestSchema>;
751
+ export type EmbeddingContext = Static<typeof embeddingContextSchema>;
752
+ export type EmbeddingUsage = Static<typeof embeddingUsageSchema>;
753
+ export type EmbeddingAttempt = Static<typeof embeddingAttemptSchema>;
754
+ export type EmbeddingOutcome = Static<typeof embeddingOutcomeSchema>;
755
+ export type EmbeddingGeneration = Static<typeof embeddingGenerationSchema>;
756
+ export type EmbeddingResult = Static<typeof embeddingResultSchema>;
757
+ export type EmbeddingCompareEntry = Static<typeof embeddingCompareEntrySchema>;
758
+ export type EmbeddingCompareResult = Static<typeof embeddingCompareResultSchema>;