@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.cjs
CHANGED
|
@@ -2572,6 +2572,117 @@ var groqFactory = {
|
|
|
2572
2572
|
create: () => new GroqAdapter()
|
|
2573
2573
|
};
|
|
2574
2574
|
|
|
2575
|
+
// src/adapters/huggingface/manifest.ts
|
|
2576
|
+
var HF_KNOWN_MODELS = [
|
|
2577
|
+
{
|
|
2578
|
+
id: "meta-llama/Llama-3.3-70B-Instruct",
|
|
2579
|
+
displayName: "Llama 3.3 70B Instruct (HF Providers)",
|
|
2580
|
+
capabilities: {
|
|
2581
|
+
streaming: true,
|
|
2582
|
+
tools: true,
|
|
2583
|
+
vision: false,
|
|
2584
|
+
systemPrompt: true,
|
|
2585
|
+
maxContextTokens: 128e3
|
|
2586
|
+
}
|
|
2587
|
+
},
|
|
2588
|
+
{
|
|
2589
|
+
id: "meta-llama/Llama-3.1-8B-Instruct",
|
|
2590
|
+
displayName: "Llama 3.1 8B Instruct (HF Providers)",
|
|
2591
|
+
capabilities: {
|
|
2592
|
+
streaming: true,
|
|
2593
|
+
tools: true,
|
|
2594
|
+
vision: false,
|
|
2595
|
+
systemPrompt: true,
|
|
2596
|
+
maxContextTokens: 128e3
|
|
2597
|
+
}
|
|
2598
|
+
},
|
|
2599
|
+
{
|
|
2600
|
+
id: "Qwen/Qwen2.5-72B-Instruct",
|
|
2601
|
+
displayName: "Qwen 2.5 72B Instruct (HF Providers)",
|
|
2602
|
+
capabilities: {
|
|
2603
|
+
streaming: true,
|
|
2604
|
+
tools: true,
|
|
2605
|
+
vision: false,
|
|
2606
|
+
systemPrompt: true,
|
|
2607
|
+
maxContextTokens: 128e3
|
|
2608
|
+
}
|
|
2609
|
+
},
|
|
2610
|
+
{
|
|
2611
|
+
id: "mistralai/Mistral-7B-Instruct-v0.3",
|
|
2612
|
+
displayName: "Mistral 7B Instruct v0.3 (HF Providers)",
|
|
2613
|
+
capabilities: {
|
|
2614
|
+
streaming: true,
|
|
2615
|
+
tools: true,
|
|
2616
|
+
vision: false,
|
|
2617
|
+
systemPrompt: true,
|
|
2618
|
+
maxContextTokens: 32e3
|
|
2619
|
+
}
|
|
2620
|
+
},
|
|
2621
|
+
{
|
|
2622
|
+
id: "deepseek-ai/DeepSeek-V3",
|
|
2623
|
+
displayName: "DeepSeek V3 (HF Providers)",
|
|
2624
|
+
capabilities: {
|
|
2625
|
+
streaming: true,
|
|
2626
|
+
tools: true,
|
|
2627
|
+
vision: false,
|
|
2628
|
+
systemPrompt: true,
|
|
2629
|
+
maxContextTokens: 64e3
|
|
2630
|
+
}
|
|
2631
|
+
}
|
|
2632
|
+
];
|
|
2633
|
+
var huggingfaceManifest = {
|
|
2634
|
+
vendor: "huggingface",
|
|
2635
|
+
displayName: "HuggingFace Inference Providers",
|
|
2636
|
+
authKinds: [
|
|
2637
|
+
{
|
|
2638
|
+
kind: "apiKey",
|
|
2639
|
+
displayName: "API Key",
|
|
2640
|
+
fields: [
|
|
2641
|
+
{
|
|
2642
|
+
name: "apiKey",
|
|
2643
|
+
label: "HuggingFace Token",
|
|
2644
|
+
type: "password",
|
|
2645
|
+
required: true,
|
|
2646
|
+
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."
|
|
2647
|
+
},
|
|
2648
|
+
{
|
|
2649
|
+
name: "baseURL",
|
|
2650
|
+
label: "Base URL",
|
|
2651
|
+
type: "url",
|
|
2652
|
+
required: false,
|
|
2653
|
+
default: "https://router.huggingface.co/v1",
|
|
2654
|
+
help: "Override only for proxies. Default is the HF Providers router endpoint."
|
|
2655
|
+
}
|
|
2656
|
+
]
|
|
2657
|
+
}
|
|
2658
|
+
],
|
|
2659
|
+
knownModels: HF_KNOWN_MODELS,
|
|
2660
|
+
// The HF router exposes /v1/models with the same Bearer auth.
|
|
2661
|
+
supportsModelListing: true,
|
|
2662
|
+
docsUrl: "https://huggingface.co/docs/inference-providers"
|
|
2663
|
+
};
|
|
2664
|
+
|
|
2665
|
+
// src/adapters/huggingface/adapter.ts
|
|
2666
|
+
var HuggingfaceAdapter = class extends OpenAIAdapter {
|
|
2667
|
+
vendor = huggingfaceManifest.vendor;
|
|
2668
|
+
init(auth, client) {
|
|
2669
|
+
super.init(
|
|
2670
|
+
{
|
|
2671
|
+
...auth,
|
|
2672
|
+
baseURL: auth.baseURL ?? "https://router.huggingface.co/v1"
|
|
2673
|
+
},
|
|
2674
|
+
client
|
|
2675
|
+
);
|
|
2676
|
+
}
|
|
2677
|
+
};
|
|
2678
|
+
|
|
2679
|
+
// src/adapters/huggingface/factory.ts
|
|
2680
|
+
var huggingfaceFactory = {
|
|
2681
|
+
vendor: huggingfaceManifest.vendor,
|
|
2682
|
+
manifest: huggingfaceManifest,
|
|
2683
|
+
create: () => new HuggingfaceAdapter()
|
|
2684
|
+
};
|
|
2685
|
+
|
|
2575
2686
|
// src/adapters/index.ts
|
|
2576
2687
|
registerAdapter(openAIFactory);
|
|
2577
2688
|
registerAdapter(deepseekFactory);
|
|
@@ -2582,6 +2693,7 @@ registerAdapter(vertexOpenAIFactory);
|
|
|
2582
2693
|
registerAdapter(bedrockFactory);
|
|
2583
2694
|
registerAdapter(azureOpenAIFactory);
|
|
2584
2695
|
registerAdapter(groqFactory);
|
|
2696
|
+
registerAdapter(huggingfaceFactory);
|
|
2585
2697
|
|
|
2586
2698
|
// src/index.ts
|
|
2587
2699
|
async function createLlm(args) {
|