@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.js
CHANGED
|
@@ -2324,21 +2324,21 @@ var azureOpenAIManifest = {
|
|
|
2324
2324
|
label: "API Key",
|
|
2325
2325
|
type: "password",
|
|
2326
2326
|
required: true,
|
|
2327
|
-
help: "Azure
|
|
2327
|
+
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."
|
|
2328
2328
|
},
|
|
2329
2329
|
{
|
|
2330
2330
|
name: "endpoint",
|
|
2331
2331
|
label: "Endpoint",
|
|
2332
2332
|
type: "url",
|
|
2333
2333
|
required: true,
|
|
2334
|
-
help: "Resource
|
|
2334
|
+
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."
|
|
2335
2335
|
},
|
|
2336
2336
|
{
|
|
2337
2337
|
name: "deployment",
|
|
2338
2338
|
label: "Deployment Name",
|
|
2339
2339
|
type: "text",
|
|
2340
2340
|
required: true,
|
|
2341
|
-
help: "The
|
|
2341
|
+
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."
|
|
2342
2342
|
},
|
|
2343
2343
|
{
|
|
2344
2344
|
name: "apiVersion",
|
|
@@ -2346,7 +2346,7 @@ var azureOpenAIManifest = {
|
|
|
2346
2346
|
type: "text",
|
|
2347
2347
|
required: true,
|
|
2348
2348
|
default: "2025-03-01-preview",
|
|
2349
|
-
help: "Data-plane api-version,
|
|
2349
|
+
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."
|
|
2350
2350
|
}
|
|
2351
2351
|
]
|
|
2352
2352
|
}
|
|
@@ -2418,7 +2418,16 @@ var AzureOpenAIAdapter = class {
|
|
|
2418
2418
|
// The newer name is a superset — also accepted by gpt-4o, gpt-4-turbo,
|
|
2419
2419
|
// and gpt-3.5-turbo deployments — so it's the safe choice for a probe
|
|
2420
2420
|
// that has to work regardless of the underlying deployment model.
|
|
2421
|
-
|
|
2421
|
+
//
|
|
2422
|
+
// 256 (not 1): reasoning models consume reasoning tokens BEFORE
|
|
2423
|
+
// visible output, all counted against this cap. With 1 the model
|
|
2424
|
+
// can't produce any output and Azure returns
|
|
2425
|
+
// `400 Could not finish the message because max_tokens or model
|
|
2426
|
+
// output limit was reached`. 256 is comfortable headroom for
|
|
2427
|
+
// reasoning + a "pong"-sized reply on every model we ship in the
|
|
2428
|
+
// manifest, while still bounded so the probe can't run away on a
|
|
2429
|
+
// misconfigured deployment.
|
|
2430
|
+
max_completion_tokens: 256,
|
|
2422
2431
|
stream: false
|
|
2423
2432
|
});
|
|
2424
2433
|
}
|
|
@@ -2441,6 +2450,95 @@ var azureOpenAIFactory = {
|
|
|
2441
2450
|
create: () => new AzureOpenAIAdapter()
|
|
2442
2451
|
};
|
|
2443
2452
|
|
|
2453
|
+
// src/adapters/groq/manifest.ts
|
|
2454
|
+
var GROQ_KNOWN_MODELS = [
|
|
2455
|
+
{
|
|
2456
|
+
id: "llama-3.3-70b-versatile",
|
|
2457
|
+
displayName: "Llama 3.3 70B Versatile (Groq)",
|
|
2458
|
+
capabilities: {
|
|
2459
|
+
streaming: true,
|
|
2460
|
+
tools: true,
|
|
2461
|
+
vision: false,
|
|
2462
|
+
systemPrompt: true,
|
|
2463
|
+
maxContextTokens: 128e3
|
|
2464
|
+
}
|
|
2465
|
+
},
|
|
2466
|
+
{
|
|
2467
|
+
id: "llama-3.1-8b-instant",
|
|
2468
|
+
displayName: "Llama 3.1 8B Instant (Groq)",
|
|
2469
|
+
capabilities: {
|
|
2470
|
+
streaming: true,
|
|
2471
|
+
tools: true,
|
|
2472
|
+
vision: false,
|
|
2473
|
+
systemPrompt: true,
|
|
2474
|
+
maxContextTokens: 128e3
|
|
2475
|
+
}
|
|
2476
|
+
},
|
|
2477
|
+
{
|
|
2478
|
+
id: "gemma2-9b-it",
|
|
2479
|
+
displayName: "Gemma 2 9B (Groq)",
|
|
2480
|
+
capabilities: {
|
|
2481
|
+
streaming: true,
|
|
2482
|
+
tools: true,
|
|
2483
|
+
vision: false,
|
|
2484
|
+
systemPrompt: true,
|
|
2485
|
+
maxContextTokens: 8192
|
|
2486
|
+
}
|
|
2487
|
+
}
|
|
2488
|
+
];
|
|
2489
|
+
var groqManifest = {
|
|
2490
|
+
vendor: "groq",
|
|
2491
|
+
displayName: "Groq",
|
|
2492
|
+
authKinds: [
|
|
2493
|
+
{
|
|
2494
|
+
kind: "apiKey",
|
|
2495
|
+
displayName: "API Key",
|
|
2496
|
+
fields: [
|
|
2497
|
+
{
|
|
2498
|
+
name: "apiKey",
|
|
2499
|
+
label: "API Key",
|
|
2500
|
+
type: "password",
|
|
2501
|
+
required: true,
|
|
2502
|
+
help: "Get an API key from https://console.groq.com/keys."
|
|
2503
|
+
},
|
|
2504
|
+
{
|
|
2505
|
+
name: "baseURL",
|
|
2506
|
+
label: "Base URL",
|
|
2507
|
+
type: "url",
|
|
2508
|
+
required: false,
|
|
2509
|
+
default: "https://api.groq.com/openai/v1",
|
|
2510
|
+
help: "Override only for proxies. Default points at Groq's production endpoint."
|
|
2511
|
+
}
|
|
2512
|
+
]
|
|
2513
|
+
}
|
|
2514
|
+
],
|
|
2515
|
+
knownModels: GROQ_KNOWN_MODELS,
|
|
2516
|
+
// Groq exposes /openai/v1/models with the same auth as chat completions.
|
|
2517
|
+
supportsModelListing: true,
|
|
2518
|
+
docsUrl: "https://console.groq.com/docs/api-reference"
|
|
2519
|
+
};
|
|
2520
|
+
|
|
2521
|
+
// src/adapters/groq/adapter.ts
|
|
2522
|
+
var GroqAdapter = class extends OpenAIAdapter {
|
|
2523
|
+
vendor = groqManifest.vendor;
|
|
2524
|
+
init(auth, client) {
|
|
2525
|
+
super.init(
|
|
2526
|
+
{
|
|
2527
|
+
...auth,
|
|
2528
|
+
baseURL: auth.baseURL ?? "https://api.groq.com/openai/v1"
|
|
2529
|
+
},
|
|
2530
|
+
client
|
|
2531
|
+
);
|
|
2532
|
+
}
|
|
2533
|
+
};
|
|
2534
|
+
|
|
2535
|
+
// src/adapters/groq/factory.ts
|
|
2536
|
+
var groqFactory = {
|
|
2537
|
+
vendor: groqManifest.vendor,
|
|
2538
|
+
manifest: groqManifest,
|
|
2539
|
+
create: () => new GroqAdapter()
|
|
2540
|
+
};
|
|
2541
|
+
|
|
2444
2542
|
// src/adapters/index.ts
|
|
2445
2543
|
registerAdapter(openAIFactory);
|
|
2446
2544
|
registerAdapter(deepseekFactory);
|
|
@@ -2450,6 +2548,7 @@ registerAdapter(vertexGeminiFactory);
|
|
|
2450
2548
|
registerAdapter(vertexOpenAIFactory);
|
|
2451
2549
|
registerAdapter(bedrockFactory);
|
|
2452
2550
|
registerAdapter(azureOpenAIFactory);
|
|
2551
|
+
registerAdapter(groqFactory);
|
|
2453
2552
|
|
|
2454
2553
|
// src/index.ts
|
|
2455
2554
|
async function createLlm(args) {
|