@jambonz/llm 0.4.2 → 0.4.4

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/dist/index.js CHANGED
@@ -2331,21 +2331,21 @@ var azureOpenAIManifest = {
2331
2331
  label: "API Key",
2332
2332
  type: "password",
2333
2333
  required: true,
2334
- help: "Azure OpenAI resource key. Find it in the Azure portal under your OpenAI resource \u2192 Keys and Endpoint."
2334
+ help: "In Azure AI Foundry, open the deployment and copy the Key from the Endpoint panel (eye icon to reveal). Same key is shown in the Azure portal under your OpenAI resource \u2192 Keys and Endpoint."
2335
2335
  },
2336
2336
  {
2337
2337
  name: "endpoint",
2338
2338
  label: "Endpoint",
2339
2339
  type: "url",
2340
2340
  required: true,
2341
- help: "Resource endpoint URL, e.g. https://my-resource.openai.azure.com. Shown in the Azure portal alongside the keys."
2341
+ help: "Resource hostname only \u2014 no path, no query string. Example: https://my-resource.openai.azure.com. The Foundry deployment page shows a Target URI like https://my-resource.openai.azure.com/openai/responses?api-version=\u2026 Strip everything from /openai/ onward and paste only the part before it."
2342
2342
  },
2343
2343
  {
2344
2344
  name: "deployment",
2345
2345
  label: "Deployment Name",
2346
2346
  type: "text",
2347
2347
  required: true,
2348
- help: "The name you chose for the deployment in Azure AI Studio (NOT the underlying model id \u2014 deployments can be named anything)."
2348
+ help: "The Name shown at the top of the deployment page in Azure AI Foundry (also under Deployment info \u2192 Name). NOT the underlying model id \u2014 deployments can be named anything you chose at create time."
2349
2349
  },
2350
2350
  {
2351
2351
  name: "apiVersion",
@@ -2353,7 +2353,7 @@ var azureOpenAIManifest = {
2353
2353
  type: "text",
2354
2354
  required: true,
2355
2355
  default: "2025-03-01-preview",
2356
- help: "Data-plane api-version, e.g. 2025-03-01-preview. Microsoft rolls these frequently; newer gpt-5 / o-series deployments require an api-version that supports the Responses API (2025-03-01-preview or later). See Azure OpenAI API reference docs for the current recommended version."
2356
+ help: "Data-plane api-version. Visible in Foundry as the ?api-version=\u2026 query string in the Target URI, or the api_version=\u2026 line in the Python sample. The default 2025-03-01-preview is the minimum that works with gpt-5 / o-series deployments \u2014 Azure routes those through the Responses API internally and rejects older versions."
2357
2357
  }
2358
2358
  ]
2359
2359
  }
@@ -2425,7 +2425,16 @@ var AzureOpenAIAdapter = class {
2425
2425
  // The newer name is a superset — also accepted by gpt-4o, gpt-4-turbo,
2426
2426
  // and gpt-3.5-turbo deployments — so it's the safe choice for a probe
2427
2427
  // that has to work regardless of the underlying deployment model.
2428
- max_completion_tokens: 1,
2428
+ //
2429
+ // 256 (not 1): reasoning models consume reasoning tokens BEFORE
2430
+ // visible output, all counted against this cap. With 1 the model
2431
+ // can't produce any output and Azure returns
2432
+ // `400 Could not finish the message because max_tokens or model
2433
+ // output limit was reached`. 256 is comfortable headroom for
2434
+ // reasoning + a "pong"-sized reply on every model we ship in the
2435
+ // manifest, while still bounded so the probe can't run away on a
2436
+ // misconfigured deployment.
2437
+ max_completion_tokens: 256,
2429
2438
  stream: false
2430
2439
  });
2431
2440
  }
@@ -2448,6 +2457,95 @@ var azureOpenAIFactory = {
2448
2457
  create: () => new AzureOpenAIAdapter()
2449
2458
  };
2450
2459
 
2460
+ // src/adapters/groq/manifest.ts
2461
+ var GROQ_KNOWN_MODELS = [
2462
+ {
2463
+ id: "llama-3.3-70b-versatile",
2464
+ displayName: "Llama 3.3 70B Versatile (Groq)",
2465
+ capabilities: {
2466
+ streaming: true,
2467
+ tools: true,
2468
+ vision: false,
2469
+ systemPrompt: true,
2470
+ maxContextTokens: 128e3
2471
+ }
2472
+ },
2473
+ {
2474
+ id: "llama-3.1-8b-instant",
2475
+ displayName: "Llama 3.1 8B Instant (Groq)",
2476
+ capabilities: {
2477
+ streaming: true,
2478
+ tools: true,
2479
+ vision: false,
2480
+ systemPrompt: true,
2481
+ maxContextTokens: 128e3
2482
+ }
2483
+ },
2484
+ {
2485
+ id: "gemma2-9b-it",
2486
+ displayName: "Gemma 2 9B (Groq)",
2487
+ capabilities: {
2488
+ streaming: true,
2489
+ tools: true,
2490
+ vision: false,
2491
+ systemPrompt: true,
2492
+ maxContextTokens: 8192
2493
+ }
2494
+ }
2495
+ ];
2496
+ var groqManifest = {
2497
+ vendor: "groq",
2498
+ displayName: "Groq",
2499
+ authKinds: [
2500
+ {
2501
+ kind: "apiKey",
2502
+ displayName: "API Key",
2503
+ fields: [
2504
+ {
2505
+ name: "apiKey",
2506
+ label: "API Key",
2507
+ type: "password",
2508
+ required: true,
2509
+ help: "Get an API key from https://console.groq.com/keys."
2510
+ },
2511
+ {
2512
+ name: "baseURL",
2513
+ label: "Base URL",
2514
+ type: "url",
2515
+ required: false,
2516
+ default: "https://api.groq.com/openai/v1",
2517
+ help: "Override only for proxies. Default points at Groq's production endpoint."
2518
+ }
2519
+ ]
2520
+ }
2521
+ ],
2522
+ knownModels: GROQ_KNOWN_MODELS,
2523
+ // Groq exposes /openai/v1/models with the same auth as chat completions.
2524
+ supportsModelListing: true,
2525
+ docsUrl: "https://console.groq.com/docs/api-reference"
2526
+ };
2527
+
2528
+ // src/adapters/groq/adapter.ts
2529
+ var GroqAdapter = class extends OpenAIAdapter {
2530
+ vendor = groqManifest.vendor;
2531
+ init(auth, client) {
2532
+ super.init(
2533
+ {
2534
+ ...auth,
2535
+ baseURL: auth.baseURL ?? "https://api.groq.com/openai/v1"
2536
+ },
2537
+ client
2538
+ );
2539
+ }
2540
+ };
2541
+
2542
+ // src/adapters/groq/factory.ts
2543
+ var groqFactory = {
2544
+ vendor: groqManifest.vendor,
2545
+ manifest: groqManifest,
2546
+ create: () => new GroqAdapter()
2547
+ };
2548
+
2451
2549
  // src/adapters/index.ts
2452
2550
  registerAdapter(openAIFactory);
2453
2551
  registerAdapter(deepseekFactory);
@@ -2457,6 +2555,7 @@ registerAdapter(vertexGeminiFactory);
2457
2555
  registerAdapter(vertexOpenAIFactory);
2458
2556
  registerAdapter(bedrockFactory);
2459
2557
  registerAdapter(azureOpenAIFactory);
2558
+ registerAdapter(groqFactory);
2460
2559
 
2461
2560
  // src/normalize-auth.ts
2462
2561
  function normalizeAuth(vendor, raw) {