@jambonz/llm 0.2.6 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/index.cjs +39 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +42 -2
- package/dist/index.js.map +1 -1
- package/dist/test-kit/index.cjs +47 -2
- package/dist/test-kit/index.cjs.map +1 -1
- package/dist/test-kit/index.d.cts +2 -1
- package/dist/test-kit/index.d.ts +2 -1
- package/dist/test-kit/index.js +50 -2
- package/dist/test-kit/index.js.map +1 -1
- package/dist/{types-bq1XMi_T.d.cts → types-4d2QrlAe.d.cts} +22 -0
- package/dist/{types-bq1XMi_T.d.ts → types-4d2QrlAe.d.ts} +22 -0
- package/package.json +3 -1
|
@@ -269,6 +269,28 @@ interface LlmAdapter<A extends AuthSpec = AuthSpec> {
|
|
|
269
269
|
* in that case.
|
|
270
270
|
*/
|
|
271
271
|
listAvailableModels(): Promise<ModelInfo[]>;
|
|
272
|
+
/**
|
|
273
|
+
* Verify the credential this adapter was initialized with. This is an auth
|
|
274
|
+
* check, not a capability check — success means "the vendor accepts these
|
|
275
|
+
* credentials"; it does not imply any specific model is accessible.
|
|
276
|
+
*
|
|
277
|
+
* Each adapter picks the cheapest authenticated call available:
|
|
278
|
+
* - Vendors with a list-models endpoint call it and discard the result.
|
|
279
|
+
* - Vendors without a list-models endpoint (Vertex-OpenAI, the OpenAI-
|
|
280
|
+
* compatible MaaS layer) mint a bearer token or hit a zero-cost auth
|
|
281
|
+
* endpoint.
|
|
282
|
+
*
|
|
283
|
+
* Resolves on success, throws on failure. Failure messages should surface
|
|
284
|
+
* the vendor's own error (401/403 for bad credentials, 404 for missing
|
|
285
|
+
* project, etc.) so operators can diagnose without guessing.
|
|
286
|
+
*
|
|
287
|
+
* Callers (e.g., api-server's POST/PUT credential routes) use this instead
|
|
288
|
+
* of streaming a probe prompt. Avoid reaching for a stream probe as a
|
|
289
|
+
* fallback: it requires a specific model grant, which is an accidental
|
|
290
|
+
* coupling between "is this credential valid" and "does this account have
|
|
291
|
+
* Mistral/Llama/etc. enabled".
|
|
292
|
+
*/
|
|
293
|
+
testCredential(): Promise<void>;
|
|
272
294
|
/**
|
|
273
295
|
* Optional: pre-establish connection to the vendor API. Useful for reducing
|
|
274
296
|
* cold-start latency on the first prompt. No-op if not implemented.
|
|
@@ -269,6 +269,28 @@ interface LlmAdapter<A extends AuthSpec = AuthSpec> {
|
|
|
269
269
|
* in that case.
|
|
270
270
|
*/
|
|
271
271
|
listAvailableModels(): Promise<ModelInfo[]>;
|
|
272
|
+
/**
|
|
273
|
+
* Verify the credential this adapter was initialized with. This is an auth
|
|
274
|
+
* check, not a capability check — success means "the vendor accepts these
|
|
275
|
+
* credentials"; it does not imply any specific model is accessible.
|
|
276
|
+
*
|
|
277
|
+
* Each adapter picks the cheapest authenticated call available:
|
|
278
|
+
* - Vendors with a list-models endpoint call it and discard the result.
|
|
279
|
+
* - Vendors without a list-models endpoint (Vertex-OpenAI, the OpenAI-
|
|
280
|
+
* compatible MaaS layer) mint a bearer token or hit a zero-cost auth
|
|
281
|
+
* endpoint.
|
|
282
|
+
*
|
|
283
|
+
* Resolves on success, throws on failure. Failure messages should surface
|
|
284
|
+
* the vendor's own error (401/403 for bad credentials, 404 for missing
|
|
285
|
+
* project, etc.) so operators can diagnose without guessing.
|
|
286
|
+
*
|
|
287
|
+
* Callers (e.g., api-server's POST/PUT credential routes) use this instead
|
|
288
|
+
* of streaming a probe prompt. Avoid reaching for a stream probe as a
|
|
289
|
+
* fallback: it requires a specific model grant, which is an accidental
|
|
290
|
+
* coupling between "is this credential valid" and "does this account have
|
|
291
|
+
* Mistral/Llama/etc. enabled".
|
|
292
|
+
*/
|
|
293
|
+
testCredential(): Promise<void>;
|
|
272
294
|
/**
|
|
273
295
|
* Optional: pre-establish connection to the vendor API. Useful for reducing
|
|
274
296
|
* cold-start latency on the first prompt. No-op if not implemented.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jambonz/llm",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Voice-oriented LLM adapter library — a uniform interface for streaming chat completions from multiple LLM vendors, with first-class support for tool calls, AbortSignal interruption, and lossless history round-tripping.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"test:watch": "vitest",
|
|
36
36
|
"test:coverage": "vitest run --coverage",
|
|
37
37
|
"test:integration": "vitest run --config vitest.integration.config.ts",
|
|
38
|
+
"check:bedrock-models": "tsx scripts/check-bedrock-models.ts",
|
|
38
39
|
"prepublishOnly": "npm run lint && npm run typecheck && npm run test && npm run build"
|
|
39
40
|
},
|
|
40
41
|
"keywords": [
|
|
@@ -83,6 +84,7 @@
|
|
|
83
84
|
},
|
|
84
85
|
"dependencies": {
|
|
85
86
|
"@anthropic-ai/sdk": "^0.91.0",
|
|
87
|
+
"@aws-sdk/client-bedrock": "^3.1036.0",
|
|
86
88
|
"@aws-sdk/client-bedrock-runtime": "^3.1036.0",
|
|
87
89
|
"@google/genai": "^1.50.1",
|
|
88
90
|
"google-auth-library": "^10.6.2",
|