@jambonz/llm 0.4.4 → 0.4.6
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 +115 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +115 -1
- package/dist/index.js.map +1 -1
- package/dist/test-kit/index.cjs +113 -1
- package/dist/test-kit/index.cjs.map +1 -1
- package/dist/test-kit/index.js +113 -1
- package/dist/test-kit/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -33,7 +33,7 @@ interface RawCredential {
|
|
|
33
33
|
*
|
|
34
34
|
* Supported vendors: openai, deepseek, anthropic, google, vertex (alias for
|
|
35
35
|
* vertex-gemini + vertex-openai — both accept the same auth shape), vertex-gemini,
|
|
36
|
-
* vertex-openai, bedrock, azure-openai.
|
|
36
|
+
* vertex-openai, bedrock, azure-openai, groq, huggingface.
|
|
37
37
|
*
|
|
38
38
|
* Throws with a clear message if the raw credential is missing required fields.
|
|
39
39
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ interface RawCredential {
|
|
|
33
33
|
*
|
|
34
34
|
* Supported vendors: openai, deepseek, anthropic, google, vertex (alias for
|
|
35
35
|
* vertex-gemini + vertex-openai — both accept the same auth shape), vertex-gemini,
|
|
36
|
-
* vertex-openai, bedrock, azure-openai.
|
|
36
|
+
* vertex-openai, bedrock, azure-openai, groq, huggingface.
|
|
37
37
|
*
|
|
38
38
|
* Throws with a clear message if the raw credential is missing required fields.
|
|
39
39
|
*/
|
package/dist/index.js
CHANGED
|
@@ -2506,7 +2506,7 @@ var groqManifest = {
|
|
|
2506
2506
|
label: "API Key",
|
|
2507
2507
|
type: "password",
|
|
2508
2508
|
required: true,
|
|
2509
|
-
help: "Get an API key from https://console.groq.com/keys
|
|
2509
|
+
help: "Get an API key from https://console.groq.com/keys (sign in first if needed)"
|
|
2510
2510
|
},
|
|
2511
2511
|
{
|
|
2512
2512
|
name: "baseURL",
|
|
@@ -2546,6 +2546,117 @@ var groqFactory = {
|
|
|
2546
2546
|
create: () => new GroqAdapter()
|
|
2547
2547
|
};
|
|
2548
2548
|
|
|
2549
|
+
// src/adapters/huggingface/manifest.ts
|
|
2550
|
+
var HF_KNOWN_MODELS = [
|
|
2551
|
+
{
|
|
2552
|
+
id: "meta-llama/Llama-3.3-70B-Instruct",
|
|
2553
|
+
displayName: "Llama 3.3 70B Instruct (HF Providers)",
|
|
2554
|
+
capabilities: {
|
|
2555
|
+
streaming: true,
|
|
2556
|
+
tools: true,
|
|
2557
|
+
vision: false,
|
|
2558
|
+
systemPrompt: true,
|
|
2559
|
+
maxContextTokens: 128e3
|
|
2560
|
+
}
|
|
2561
|
+
},
|
|
2562
|
+
{
|
|
2563
|
+
id: "meta-llama/Llama-3.1-8B-Instruct",
|
|
2564
|
+
displayName: "Llama 3.1 8B Instruct (HF Providers)",
|
|
2565
|
+
capabilities: {
|
|
2566
|
+
streaming: true,
|
|
2567
|
+
tools: true,
|
|
2568
|
+
vision: false,
|
|
2569
|
+
systemPrompt: true,
|
|
2570
|
+
maxContextTokens: 128e3
|
|
2571
|
+
}
|
|
2572
|
+
},
|
|
2573
|
+
{
|
|
2574
|
+
id: "Qwen/Qwen2.5-72B-Instruct",
|
|
2575
|
+
displayName: "Qwen 2.5 72B Instruct (HF Providers)",
|
|
2576
|
+
capabilities: {
|
|
2577
|
+
streaming: true,
|
|
2578
|
+
tools: true,
|
|
2579
|
+
vision: false,
|
|
2580
|
+
systemPrompt: true,
|
|
2581
|
+
maxContextTokens: 128e3
|
|
2582
|
+
}
|
|
2583
|
+
},
|
|
2584
|
+
{
|
|
2585
|
+
id: "mistralai/Mistral-7B-Instruct-v0.3",
|
|
2586
|
+
displayName: "Mistral 7B Instruct v0.3 (HF Providers)",
|
|
2587
|
+
capabilities: {
|
|
2588
|
+
streaming: true,
|
|
2589
|
+
tools: true,
|
|
2590
|
+
vision: false,
|
|
2591
|
+
systemPrompt: true,
|
|
2592
|
+
maxContextTokens: 32e3
|
|
2593
|
+
}
|
|
2594
|
+
},
|
|
2595
|
+
{
|
|
2596
|
+
id: "deepseek-ai/DeepSeek-V3",
|
|
2597
|
+
displayName: "DeepSeek V3 (HF Providers)",
|
|
2598
|
+
capabilities: {
|
|
2599
|
+
streaming: true,
|
|
2600
|
+
tools: true,
|
|
2601
|
+
vision: false,
|
|
2602
|
+
systemPrompt: true,
|
|
2603
|
+
maxContextTokens: 64e3
|
|
2604
|
+
}
|
|
2605
|
+
}
|
|
2606
|
+
];
|
|
2607
|
+
var huggingfaceManifest = {
|
|
2608
|
+
vendor: "huggingface",
|
|
2609
|
+
displayName: "HuggingFace Inference Providers",
|
|
2610
|
+
authKinds: [
|
|
2611
|
+
{
|
|
2612
|
+
kind: "apiKey",
|
|
2613
|
+
displayName: "API Key",
|
|
2614
|
+
fields: [
|
|
2615
|
+
{
|
|
2616
|
+
name: "apiKey",
|
|
2617
|
+
label: "HuggingFace Token",
|
|
2618
|
+
type: "password",
|
|
2619
|
+
required: true,
|
|
2620
|
+
help: "Get a token from https://huggingface.co/settings/tokens (Read scope is sufficient). Inference Providers requires a credit balance \u2014 claim the free monthly tier or attach a payment method at https://huggingface.co/billing."
|
|
2621
|
+
},
|
|
2622
|
+
{
|
|
2623
|
+
name: "baseURL",
|
|
2624
|
+
label: "Base URL",
|
|
2625
|
+
type: "url",
|
|
2626
|
+
required: false,
|
|
2627
|
+
default: "https://router.huggingface.co/v1",
|
|
2628
|
+
help: "Override only for proxies. Default is the HF Providers router endpoint."
|
|
2629
|
+
}
|
|
2630
|
+
]
|
|
2631
|
+
}
|
|
2632
|
+
],
|
|
2633
|
+
knownModels: HF_KNOWN_MODELS,
|
|
2634
|
+
// The HF router exposes /v1/models with the same Bearer auth.
|
|
2635
|
+
supportsModelListing: true,
|
|
2636
|
+
docsUrl: "https://huggingface.co/docs/inference-providers"
|
|
2637
|
+
};
|
|
2638
|
+
|
|
2639
|
+
// src/adapters/huggingface/adapter.ts
|
|
2640
|
+
var HuggingfaceAdapter = class extends OpenAIAdapter {
|
|
2641
|
+
vendor = huggingfaceManifest.vendor;
|
|
2642
|
+
init(auth, client) {
|
|
2643
|
+
super.init(
|
|
2644
|
+
{
|
|
2645
|
+
...auth,
|
|
2646
|
+
baseURL: auth.baseURL ?? "https://router.huggingface.co/v1"
|
|
2647
|
+
},
|
|
2648
|
+
client
|
|
2649
|
+
);
|
|
2650
|
+
}
|
|
2651
|
+
};
|
|
2652
|
+
|
|
2653
|
+
// src/adapters/huggingface/factory.ts
|
|
2654
|
+
var huggingfaceFactory = {
|
|
2655
|
+
vendor: huggingfaceManifest.vendor,
|
|
2656
|
+
manifest: huggingfaceManifest,
|
|
2657
|
+
create: () => new HuggingfaceAdapter()
|
|
2658
|
+
};
|
|
2659
|
+
|
|
2549
2660
|
// src/adapters/index.ts
|
|
2550
2661
|
registerAdapter(openAIFactory);
|
|
2551
2662
|
registerAdapter(deepseekFactory);
|
|
@@ -2556,12 +2667,15 @@ registerAdapter(vertexOpenAIFactory);
|
|
|
2556
2667
|
registerAdapter(bedrockFactory);
|
|
2557
2668
|
registerAdapter(azureOpenAIFactory);
|
|
2558
2669
|
registerAdapter(groqFactory);
|
|
2670
|
+
registerAdapter(huggingfaceFactory);
|
|
2559
2671
|
|
|
2560
2672
|
// src/normalize-auth.ts
|
|
2561
2673
|
function normalizeAuth(vendor, raw) {
|
|
2562
2674
|
switch (vendor) {
|
|
2563
2675
|
case "openai":
|
|
2564
2676
|
case "anthropic":
|
|
2677
|
+
case "groq":
|
|
2678
|
+
case "huggingface":
|
|
2565
2679
|
return requireApiKey(vendor, raw);
|
|
2566
2680
|
case "deepseek":
|
|
2567
2681
|
return {
|