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