@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.cjs +104 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +104 -5
- package/dist/index.js.map +1 -1
- package/dist/test-kit/index.cjs +104 -5
- package/dist/test-kit/index.cjs.map +1 -1
- package/dist/test-kit/index.js +104 -5
- package/dist/test-kit/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2370,21 +2370,21 @@ var azureOpenAIManifest = {
|
|
|
2370
2370
|
label: "API Key",
|
|
2371
2371
|
type: "password",
|
|
2372
2372
|
required: true,
|
|
2373
|
-
help: "Azure
|
|
2373
|
+
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."
|
|
2374
2374
|
},
|
|
2375
2375
|
{
|
|
2376
2376
|
name: "endpoint",
|
|
2377
2377
|
label: "Endpoint",
|
|
2378
2378
|
type: "url",
|
|
2379
2379
|
required: true,
|
|
2380
|
-
help: "Resource
|
|
2380
|
+
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."
|
|
2381
2381
|
},
|
|
2382
2382
|
{
|
|
2383
2383
|
name: "deployment",
|
|
2384
2384
|
label: "Deployment Name",
|
|
2385
2385
|
type: "text",
|
|
2386
2386
|
required: true,
|
|
2387
|
-
help: "The
|
|
2387
|
+
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."
|
|
2388
2388
|
},
|
|
2389
2389
|
{
|
|
2390
2390
|
name: "apiVersion",
|
|
@@ -2392,7 +2392,7 @@ var azureOpenAIManifest = {
|
|
|
2392
2392
|
type: "text",
|
|
2393
2393
|
required: true,
|
|
2394
2394
|
default: "2025-03-01-preview",
|
|
2395
|
-
help: "Data-plane api-version,
|
|
2395
|
+
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."
|
|
2396
2396
|
}
|
|
2397
2397
|
]
|
|
2398
2398
|
}
|
|
@@ -2464,7 +2464,16 @@ var AzureOpenAIAdapter = class {
|
|
|
2464
2464
|
// The newer name is a superset — also accepted by gpt-4o, gpt-4-turbo,
|
|
2465
2465
|
// and gpt-3.5-turbo deployments — so it's the safe choice for a probe
|
|
2466
2466
|
// that has to work regardless of the underlying deployment model.
|
|
2467
|
-
|
|
2467
|
+
//
|
|
2468
|
+
// 256 (not 1): reasoning models consume reasoning tokens BEFORE
|
|
2469
|
+
// visible output, all counted against this cap. With 1 the model
|
|
2470
|
+
// can't produce any output and Azure returns
|
|
2471
|
+
// `400 Could not finish the message because max_tokens or model
|
|
2472
|
+
// output limit was reached`. 256 is comfortable headroom for
|
|
2473
|
+
// reasoning + a "pong"-sized reply on every model we ship in the
|
|
2474
|
+
// manifest, while still bounded so the probe can't run away on a
|
|
2475
|
+
// misconfigured deployment.
|
|
2476
|
+
max_completion_tokens: 256,
|
|
2468
2477
|
stream: false
|
|
2469
2478
|
});
|
|
2470
2479
|
}
|
|
@@ -2487,6 +2496,95 @@ var azureOpenAIFactory = {
|
|
|
2487
2496
|
create: () => new AzureOpenAIAdapter()
|
|
2488
2497
|
};
|
|
2489
2498
|
|
|
2499
|
+
// src/adapters/groq/manifest.ts
|
|
2500
|
+
var GROQ_KNOWN_MODELS = [
|
|
2501
|
+
{
|
|
2502
|
+
id: "llama-3.3-70b-versatile",
|
|
2503
|
+
displayName: "Llama 3.3 70B Versatile (Groq)",
|
|
2504
|
+
capabilities: {
|
|
2505
|
+
streaming: true,
|
|
2506
|
+
tools: true,
|
|
2507
|
+
vision: false,
|
|
2508
|
+
systemPrompt: true,
|
|
2509
|
+
maxContextTokens: 128e3
|
|
2510
|
+
}
|
|
2511
|
+
},
|
|
2512
|
+
{
|
|
2513
|
+
id: "llama-3.1-8b-instant",
|
|
2514
|
+
displayName: "Llama 3.1 8B Instant (Groq)",
|
|
2515
|
+
capabilities: {
|
|
2516
|
+
streaming: true,
|
|
2517
|
+
tools: true,
|
|
2518
|
+
vision: false,
|
|
2519
|
+
systemPrompt: true,
|
|
2520
|
+
maxContextTokens: 128e3
|
|
2521
|
+
}
|
|
2522
|
+
},
|
|
2523
|
+
{
|
|
2524
|
+
id: "gemma2-9b-it",
|
|
2525
|
+
displayName: "Gemma 2 9B (Groq)",
|
|
2526
|
+
capabilities: {
|
|
2527
|
+
streaming: true,
|
|
2528
|
+
tools: true,
|
|
2529
|
+
vision: false,
|
|
2530
|
+
systemPrompt: true,
|
|
2531
|
+
maxContextTokens: 8192
|
|
2532
|
+
}
|
|
2533
|
+
}
|
|
2534
|
+
];
|
|
2535
|
+
var groqManifest = {
|
|
2536
|
+
vendor: "groq",
|
|
2537
|
+
displayName: "Groq",
|
|
2538
|
+
authKinds: [
|
|
2539
|
+
{
|
|
2540
|
+
kind: "apiKey",
|
|
2541
|
+
displayName: "API Key",
|
|
2542
|
+
fields: [
|
|
2543
|
+
{
|
|
2544
|
+
name: "apiKey",
|
|
2545
|
+
label: "API Key",
|
|
2546
|
+
type: "password",
|
|
2547
|
+
required: true,
|
|
2548
|
+
help: "Get an API key from https://console.groq.com/keys."
|
|
2549
|
+
},
|
|
2550
|
+
{
|
|
2551
|
+
name: "baseURL",
|
|
2552
|
+
label: "Base URL",
|
|
2553
|
+
type: "url",
|
|
2554
|
+
required: false,
|
|
2555
|
+
default: "https://api.groq.com/openai/v1",
|
|
2556
|
+
help: "Override only for proxies. Default points at Groq's production endpoint."
|
|
2557
|
+
}
|
|
2558
|
+
]
|
|
2559
|
+
}
|
|
2560
|
+
],
|
|
2561
|
+
knownModels: GROQ_KNOWN_MODELS,
|
|
2562
|
+
// Groq exposes /openai/v1/models with the same auth as chat completions.
|
|
2563
|
+
supportsModelListing: true,
|
|
2564
|
+
docsUrl: "https://console.groq.com/docs/api-reference"
|
|
2565
|
+
};
|
|
2566
|
+
|
|
2567
|
+
// src/adapters/groq/adapter.ts
|
|
2568
|
+
var GroqAdapter = class extends OpenAIAdapter {
|
|
2569
|
+
vendor = groqManifest.vendor;
|
|
2570
|
+
init(auth, client) {
|
|
2571
|
+
super.init(
|
|
2572
|
+
{
|
|
2573
|
+
...auth,
|
|
2574
|
+
baseURL: auth.baseURL ?? "https://api.groq.com/openai/v1"
|
|
2575
|
+
},
|
|
2576
|
+
client
|
|
2577
|
+
);
|
|
2578
|
+
}
|
|
2579
|
+
};
|
|
2580
|
+
|
|
2581
|
+
// src/adapters/groq/factory.ts
|
|
2582
|
+
var groqFactory = {
|
|
2583
|
+
vendor: groqManifest.vendor,
|
|
2584
|
+
manifest: groqManifest,
|
|
2585
|
+
create: () => new GroqAdapter()
|
|
2586
|
+
};
|
|
2587
|
+
|
|
2490
2588
|
// src/adapters/index.ts
|
|
2491
2589
|
registerAdapter(openAIFactory);
|
|
2492
2590
|
registerAdapter(deepseekFactory);
|
|
@@ -2496,6 +2594,7 @@ registerAdapter(vertexGeminiFactory);
|
|
|
2496
2594
|
registerAdapter(vertexOpenAIFactory);
|
|
2497
2595
|
registerAdapter(bedrockFactory);
|
|
2498
2596
|
registerAdapter(azureOpenAIFactory);
|
|
2597
|
+
registerAdapter(groqFactory);
|
|
2499
2598
|
|
|
2500
2599
|
// src/normalize-auth.ts
|
|
2501
2600
|
function normalizeAuth(vendor, raw) {
|