@jambonz/llm 0.2.7 → 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.
@@ -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.2.7",
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",
@@ -70,7 +70,6 @@
70
70
  }
71
71
  },
72
72
  "devDependencies": {
73
- "@aws-sdk/client-bedrock": "^3.1036.0",
74
73
  "@eslint/js": "^9.17.0",
75
74
  "@types/node": "^22.10.0",
76
75
  "@vitest/coverage-v8": "^3.0.0",
@@ -85,6 +84,7 @@
85
84
  },
86
85
  "dependencies": {
87
86
  "@anthropic-ai/sdk": "^0.91.0",
87
+ "@aws-sdk/client-bedrock": "^3.1036.0",
88
88
  "@aws-sdk/client-bedrock-runtime": "^3.1036.0",
89
89
  "@google/genai": "^1.50.1",
90
90
  "google-auth-library": "^10.6.2",