@jambonz/llm 0.4.5 → 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 +113 -0
- 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 +113 -0
- package/dist/index.js.map +1 -1
- package/dist/test-kit/index.cjs +112 -0
- package/dist/test-kit/index.cjs.map +1 -1
- package/dist/test-kit/index.js +112 -0
- package/dist/test-kit/index.js.map +1 -1
- package/package.json +1 -1
package/dist/test-kit/index.js
CHANGED
|
@@ -2539,6 +2539,117 @@ var groqFactory = {
|
|
|
2539
2539
|
create: () => new GroqAdapter()
|
|
2540
2540
|
};
|
|
2541
2541
|
|
|
2542
|
+
// src/adapters/huggingface/manifest.ts
|
|
2543
|
+
var HF_KNOWN_MODELS = [
|
|
2544
|
+
{
|
|
2545
|
+
id: "meta-llama/Llama-3.3-70B-Instruct",
|
|
2546
|
+
displayName: "Llama 3.3 70B Instruct (HF Providers)",
|
|
2547
|
+
capabilities: {
|
|
2548
|
+
streaming: true,
|
|
2549
|
+
tools: true,
|
|
2550
|
+
vision: false,
|
|
2551
|
+
systemPrompt: true,
|
|
2552
|
+
maxContextTokens: 128e3
|
|
2553
|
+
}
|
|
2554
|
+
},
|
|
2555
|
+
{
|
|
2556
|
+
id: "meta-llama/Llama-3.1-8B-Instruct",
|
|
2557
|
+
displayName: "Llama 3.1 8B Instruct (HF Providers)",
|
|
2558
|
+
capabilities: {
|
|
2559
|
+
streaming: true,
|
|
2560
|
+
tools: true,
|
|
2561
|
+
vision: false,
|
|
2562
|
+
systemPrompt: true,
|
|
2563
|
+
maxContextTokens: 128e3
|
|
2564
|
+
}
|
|
2565
|
+
},
|
|
2566
|
+
{
|
|
2567
|
+
id: "Qwen/Qwen2.5-72B-Instruct",
|
|
2568
|
+
displayName: "Qwen 2.5 72B Instruct (HF Providers)",
|
|
2569
|
+
capabilities: {
|
|
2570
|
+
streaming: true,
|
|
2571
|
+
tools: true,
|
|
2572
|
+
vision: false,
|
|
2573
|
+
systemPrompt: true,
|
|
2574
|
+
maxContextTokens: 128e3
|
|
2575
|
+
}
|
|
2576
|
+
},
|
|
2577
|
+
{
|
|
2578
|
+
id: "mistralai/Mistral-7B-Instruct-v0.3",
|
|
2579
|
+
displayName: "Mistral 7B Instruct v0.3 (HF Providers)",
|
|
2580
|
+
capabilities: {
|
|
2581
|
+
streaming: true,
|
|
2582
|
+
tools: true,
|
|
2583
|
+
vision: false,
|
|
2584
|
+
systemPrompt: true,
|
|
2585
|
+
maxContextTokens: 32e3
|
|
2586
|
+
}
|
|
2587
|
+
},
|
|
2588
|
+
{
|
|
2589
|
+
id: "deepseek-ai/DeepSeek-V3",
|
|
2590
|
+
displayName: "DeepSeek V3 (HF Providers)",
|
|
2591
|
+
capabilities: {
|
|
2592
|
+
streaming: true,
|
|
2593
|
+
tools: true,
|
|
2594
|
+
vision: false,
|
|
2595
|
+
systemPrompt: true,
|
|
2596
|
+
maxContextTokens: 64e3
|
|
2597
|
+
}
|
|
2598
|
+
}
|
|
2599
|
+
];
|
|
2600
|
+
var huggingfaceManifest = {
|
|
2601
|
+
vendor: "huggingface",
|
|
2602
|
+
displayName: "HuggingFace Inference Providers",
|
|
2603
|
+
authKinds: [
|
|
2604
|
+
{
|
|
2605
|
+
kind: "apiKey",
|
|
2606
|
+
displayName: "API Key",
|
|
2607
|
+
fields: [
|
|
2608
|
+
{
|
|
2609
|
+
name: "apiKey",
|
|
2610
|
+
label: "HuggingFace Token",
|
|
2611
|
+
type: "password",
|
|
2612
|
+
required: true,
|
|
2613
|
+
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."
|
|
2614
|
+
},
|
|
2615
|
+
{
|
|
2616
|
+
name: "baseURL",
|
|
2617
|
+
label: "Base URL",
|
|
2618
|
+
type: "url",
|
|
2619
|
+
required: false,
|
|
2620
|
+
default: "https://router.huggingface.co/v1",
|
|
2621
|
+
help: "Override only for proxies. Default is the HF Providers router endpoint."
|
|
2622
|
+
}
|
|
2623
|
+
]
|
|
2624
|
+
}
|
|
2625
|
+
],
|
|
2626
|
+
knownModels: HF_KNOWN_MODELS,
|
|
2627
|
+
// The HF router exposes /v1/models with the same Bearer auth.
|
|
2628
|
+
supportsModelListing: true,
|
|
2629
|
+
docsUrl: "https://huggingface.co/docs/inference-providers"
|
|
2630
|
+
};
|
|
2631
|
+
|
|
2632
|
+
// src/adapters/huggingface/adapter.ts
|
|
2633
|
+
var HuggingfaceAdapter = class extends OpenAIAdapter {
|
|
2634
|
+
vendor = huggingfaceManifest.vendor;
|
|
2635
|
+
init(auth, client) {
|
|
2636
|
+
super.init(
|
|
2637
|
+
{
|
|
2638
|
+
...auth,
|
|
2639
|
+
baseURL: auth.baseURL ?? "https://router.huggingface.co/v1"
|
|
2640
|
+
},
|
|
2641
|
+
client
|
|
2642
|
+
);
|
|
2643
|
+
}
|
|
2644
|
+
};
|
|
2645
|
+
|
|
2646
|
+
// src/adapters/huggingface/factory.ts
|
|
2647
|
+
var huggingfaceFactory = {
|
|
2648
|
+
vendor: huggingfaceManifest.vendor,
|
|
2649
|
+
manifest: huggingfaceManifest,
|
|
2650
|
+
create: () => new HuggingfaceAdapter()
|
|
2651
|
+
};
|
|
2652
|
+
|
|
2542
2653
|
// src/adapters/index.ts
|
|
2543
2654
|
registerAdapter(openAIFactory);
|
|
2544
2655
|
registerAdapter(deepseekFactory);
|
|
@@ -2549,6 +2660,7 @@ registerAdapter(vertexOpenAIFactory);
|
|
|
2549
2660
|
registerAdapter(bedrockFactory);
|
|
2550
2661
|
registerAdapter(azureOpenAIFactory);
|
|
2551
2662
|
registerAdapter(groqFactory);
|
|
2663
|
+
registerAdapter(huggingfaceFactory);
|
|
2552
2664
|
|
|
2553
2665
|
// src/index.ts
|
|
2554
2666
|
async function createLlm(args) {
|