@kenkaiiii/gg-ai 5.48.0 → 5.49.1
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 +17 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +17 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -3,6 +3,8 @@ import Anthropic from '@anthropic-ai/sdk';
|
|
|
3
3
|
import OpenAI from 'openai';
|
|
4
4
|
|
|
5
5
|
type Provider = "anthropic" | "xiaomi" | "openai" | "gemini" | "glm" | "moonshot" | "minimax" | "deepseek" | "openrouter" | "sakana" | "xai" | "palsu"
|
|
6
|
+
/** Hugging Face Inference Providers router (OpenAI-compatible). */
|
|
7
|
+
| "huggingface"
|
|
6
8
|
/** Locally hosted OpenAI-compatible server (Ollama, LM Studio, llama.cpp, vLLM). */
|
|
7
9
|
| "local";
|
|
8
10
|
type ThinkingLevel = "low" | "medium" | "high" | "xhigh" | "max" | "ultra";
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ import Anthropic from '@anthropic-ai/sdk';
|
|
|
3
3
|
import OpenAI from 'openai';
|
|
4
4
|
|
|
5
5
|
type Provider = "anthropic" | "xiaomi" | "openai" | "gemini" | "glm" | "moonshot" | "minimax" | "deepseek" | "openrouter" | "sakana" | "xai" | "palsu"
|
|
6
|
+
/** Hugging Face Inference Providers router (OpenAI-compatible). */
|
|
7
|
+
| "huggingface"
|
|
6
8
|
/** Locally hosted OpenAI-compatible server (Ollama, LM Studio, llama.cpp, vLLM). */
|
|
7
9
|
| "local";
|
|
8
10
|
type ThinkingLevel = "low" | "medium" | "high" | "xhigh" | "max" | "ultra";
|
package/dist/index.js
CHANGED
|
@@ -59,6 +59,7 @@ var PROVIDER_DISPLAY = {
|
|
|
59
59
|
openrouter: "OpenRouter",
|
|
60
60
|
sakana: "Sakana",
|
|
61
61
|
xai: "xAI (Grok)",
|
|
62
|
+
huggingface: "Hugging Face",
|
|
62
63
|
xiaomi: "Xiaomi (MiMo)",
|
|
63
64
|
minimax: "MiniMax"
|
|
64
65
|
};
|
|
@@ -2960,6 +2961,7 @@ var CODE_ASSIST_SUPPORTED_MODELS = /* @__PURE__ */ new Set([
|
|
|
2960
2961
|
"gemini-3.5-flash",
|
|
2961
2962
|
"gemini-3-flash",
|
|
2962
2963
|
"gemini-3.1-flash-lite",
|
|
2964
|
+
"gemini-3.7-flash",
|
|
2963
2965
|
"gemini-2.5-pro",
|
|
2964
2966
|
"gemini-2.5-flash",
|
|
2965
2967
|
"gemma-4-31b-it",
|
|
@@ -2982,13 +2984,14 @@ var ACCOUNT_GATED_MODELS = /* @__PURE__ */ new Set([
|
|
|
2982
2984
|
"gemini-3-flash",
|
|
2983
2985
|
"gemini-3.5-flash",
|
|
2984
2986
|
"gemini-3.1-pro-preview",
|
|
2985
|
-
"gemini-3.1-pro-preview-customtools"
|
|
2987
|
+
"gemini-3.1-pro-preview-customtools",
|
|
2988
|
+
"gemini-3.7-flash"
|
|
2986
2989
|
]);
|
|
2987
2990
|
function accountGatedMessage(model) {
|
|
2988
2991
|
return `Your Google account isn't entitled to "${model}" over Gemini Code Assist OAuth, so the API reports it as not found. This is an account-access limit, not a ggcoder bug.`;
|
|
2989
2992
|
}
|
|
2990
2993
|
function accountGatedHint() {
|
|
2991
|
-
return `Newer Gemini models (3.5 Flash, 3.1 Pro Preview) are available only to Code Assist Standard/Enterprise accounts with preview/GA access enabled by a cloud admin \u2014 free/personal accounts usually can't call them. Switch to Gemini 3.1 Flash Lite (it works on this account) with /model, or sign in with a Code Assist Standard/Enterprise account that has preview access.`;
|
|
2994
|
+
return `Newer Gemini models (3.7 Flash, 3.5 Flash, 3.1 Pro Preview) are available only to Code Assist Standard/Enterprise accounts with preview/GA access enabled by a cloud admin \u2014 free/personal accounts usually can't call them. Switch to Gemini 3.1 Flash Lite (it works on this account) with /model, or sign in with a Code Assist Standard/Enterprise account that has preview access.`;
|
|
2992
2995
|
}
|
|
2993
2996
|
function formatErrorMessage(status, body, model) {
|
|
2994
2997
|
if (status === 404 && !CODE_ASSIST_SUPPORTED_MODELS.has(model)) {
|
|
@@ -3666,6 +3669,18 @@ providerRegistry.register("openrouter", {
|
|
|
3666
3669
|
baseUrl: options.baseUrl ?? "https://openrouter.ai/api/v1"
|
|
3667
3670
|
})
|
|
3668
3671
|
});
|
|
3672
|
+
providerRegistry.register("huggingface", {
|
|
3673
|
+
// Hugging Face Inference Providers router — one HF token (hf.co/settings/tokens,
|
|
3674
|
+
// "Make calls to Inference Providers" permission) routes to whichever hosted
|
|
3675
|
+
// backend serves each open model. Chat Completions-compatible; model ids are
|
|
3676
|
+
// Hub repo paths ("Qwen/Qwen3-Coder-480B-A35B-Instruct"), optionally with an
|
|
3677
|
+
// ":auto"/":fastest"/":cheapest" provider-selection suffix. Billing follows
|
|
3678
|
+
// each backend's per-token rates on the HF account (small free tier).
|
|
3679
|
+
stream: (options) => streamOpenAI({
|
|
3680
|
+
...options,
|
|
3681
|
+
baseUrl: options.baseUrl ?? "https://router.huggingface.co/v1"
|
|
3682
|
+
})
|
|
3683
|
+
});
|
|
3669
3684
|
providerRegistry.register("sakana", {
|
|
3670
3685
|
// Sakana Fugu is a multi-agent system exposed as a standard LLM through the
|
|
3671
3686
|
// OpenAI-compatible Sakana API. We ride the Chat Completions transport (the
|