@kenkaiiii/gg-ai 5.75.0 → 5.76.0
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/README.md +24 -8
- package/dist/index.cjs +12 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -8
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @kenkaiiii/gg-ai
|
|
2
2
|
|
|
3
3
|
<p align="center">
|
|
4
|
-
<strong>Unified LLM streaming API.
|
|
4
|
+
<strong>Unified LLM streaming API. Twelve providers plus local models. One interface.</strong>
|
|
5
5
|
</p>
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
@@ -40,10 +40,21 @@ Tool parameters are Zod schemas. Converted to JSON Schema at the provider bounda
|
|
|
40
40
|
|
|
41
41
|
| Provider | Models | Notes |
|
|
42
42
|
|---|---|---|
|
|
43
|
-
| `anthropic` | Claude Opus 5.5, Sonnet 5.5, Haiku 5.5 | Extended thinking, prompt caching, server-side compaction |
|
|
44
|
-
| `openai` | GPT-
|
|
45
|
-
| `
|
|
46
|
-
| `
|
|
43
|
+
| `anthropic` | Claude Fable 5.1, Opus 5.5, Sonnet 5.5, Haiku 5.5 | Extended thinking, prompt caching, server-side compaction |
|
|
44
|
+
| `openai` | GPT-6 Astra, GPT-6.1 Sol, GPT-6 Luna | OAuth (Codex endpoint) or API key |
|
|
45
|
+
| `gemini` | Gemini 3.1 Pro (Preview), 3.8 / 3.7 / 3.5 Flash, 3.5 / 3.1 Flash Lite | OAuth (Code Assist); native video input |
|
|
46
|
+
| `xai` | Grok 4.7 | OpenAI-compatible, `https://api.x.ai/v1` |
|
|
47
|
+
| `moonshot` | Kimi K3, K2.8 Preview, K2.7 Code, K2.7 Code HighSpeed | OpenAI-compatible; native video input |
|
|
48
|
+
| `glm` | GLM-5.3, GLM-5.3-Flash | Z.AI coding endpoint, OpenAI-compatible |
|
|
49
|
+
| `minimax` | MiniMax M3 | Anthropic-compatible endpoint |
|
|
50
|
+
| `xiaomi` | MiMo-V2.6-Pro, MiMo-V2.6-Flash, MiMo-V2.6-Pro-UltraSpeed | OpenAI-compatible |
|
|
51
|
+
| `deepseek` | DeepSeek V4 Pro, V4.1 Flash | OpenAI-compatible |
|
|
52
|
+
| `sakana` | Fugu, Fugu Max, Fugu Ultra | OpenAI-compatible |
|
|
53
|
+
| `openrouter` | Qwen3.8 Max, or any OpenRouter model id | OpenAI-compatible gateway |
|
|
54
|
+
| `huggingface` | Kimi K2.7 Code, DeepSeek V4.1 Flash, GPT-OSS 120B | Inference Providers router, OpenAI-compatible |
|
|
55
|
+
| `local` | Any model your server exposes | Ollama, LM Studio, llama.cpp, vLLM; `baseUrl` is required |
|
|
56
|
+
|
|
57
|
+
The model lists are the ones GG Coder ships in its registry (`@kenkaiiii/gg-core`). `stream()` passes `model` straight through, so any id the provider accepts works. Every provider's default endpoint can be overridden with `baseUrl`, and `providerRegistry.register()` adds your own.
|
|
47
58
|
|
|
48
59
|
---
|
|
49
60
|
|
|
@@ -52,11 +63,12 @@ Tool parameters are Zod schemas. Converted to JSON Schema at the provider bounda
|
|
|
52
63
|
| Event | Description |
|
|
53
64
|
|---|---|
|
|
54
65
|
| `text_delta` | Incremental text output |
|
|
55
|
-
| `thinking_delta` |
|
|
66
|
+
| `thinking_delta` | Reasoning output, from any provider that streams it |
|
|
56
67
|
| `toolcall_delta` | Streaming tool call arguments |
|
|
57
68
|
| `toolcall_done` | Completed tool call with parsed args |
|
|
58
69
|
| `server_toolcall` | Server-side tool invocation |
|
|
59
70
|
| `server_toolresult` | Server-side tool result |
|
|
71
|
+
| `keepalive` | Provider heartbeat: the stream is alive but has no new content yet |
|
|
60
72
|
| `done` | Stream finished, includes stop reason |
|
|
61
73
|
| `error` | Error occurred |
|
|
62
74
|
|
|
@@ -66,7 +78,7 @@ Tool parameters are Zod schemas. Converted to JSON Schema at the provider bounda
|
|
|
66
78
|
|
|
67
79
|
| Option | Type | Description |
|
|
68
80
|
|---|---|---|
|
|
69
|
-
| `provider` | `
|
|
81
|
+
| `provider` | `Provider` (any id in the table above) | Required |
|
|
70
82
|
| `model` | `string` | Required |
|
|
71
83
|
| `messages` | `Message[]` | Required |
|
|
72
84
|
| `tools` | `Tool[]` | Tool definitions with Zod schemas |
|
|
@@ -76,12 +88,16 @@ Tool parameters are Zod schemas. Converted to JSON Schema at the provider bounda
|
|
|
76
88
|
| `temperature` | `number` | Sampling temperature |
|
|
77
89
|
| `topP` | `number` | Nucleus sampling |
|
|
78
90
|
| `stop` | `string[]` | Stop sequences |
|
|
79
|
-
| `thinking` | `"low" \| "medium" \| "high" \| "max"` |
|
|
91
|
+
| `thinking` | `"low" \| "medium" \| "high" \| "xhigh" \| "max" \| "ultra"` | Reasoning effort; each provider maps it to what the model supports |
|
|
80
92
|
| `apiKey` | `string` | Provider API key |
|
|
81
93
|
| `baseUrl` | `string` | Custom endpoint |
|
|
82
94
|
| `signal` | `AbortSignal` | Cancellation |
|
|
83
95
|
| `cacheRetention` | `"none" \| "short" \| "long"` | Prompt cache preference |
|
|
96
|
+
| `promptCacheKey` | `string` | Stable cache routing key (OpenAI, Moonshot, Gemini) |
|
|
97
|
+
| `webSearch` | `boolean` | Provider-native web search where supported |
|
|
84
98
|
| `compaction` | `boolean` | Server-side compaction (Anthropic only) |
|
|
99
|
+
| `clearToolUses` | `boolean` | Server-side clearing of old tool results (Anthropic only) |
|
|
100
|
+
| `fetch` | `typeof fetch` | Custom fetch, e.g. for React Native |
|
|
85
101
|
|
|
86
102
|
---
|
|
87
103
|
|
package/dist/index.cjs
CHANGED
|
@@ -1315,11 +1315,14 @@ function toAnthropicThinking(level, maxTokens, model) {
|
|
|
1315
1315
|
effort = "high";
|
|
1316
1316
|
}
|
|
1317
1317
|
return {
|
|
1318
|
-
//
|
|
1319
|
-
//
|
|
1320
|
-
//
|
|
1321
|
-
//
|
|
1322
|
-
|
|
1318
|
+
// "omitted" (what Claude Code sends): the model still thinks, but
|
|
1319
|
+
// thinking blocks stream empty (signature only). The app never renders
|
|
1320
|
+
// reasoning text, and "summarized" costs speed on Haiku 5.5: bench/h2h
|
|
1321
|
+
// measured output tok/s over each whole request at 151 (summarized) vs
|
|
1322
|
+
// 191 (omitted); Claude Code 195. Sonnet/Opus 5.5 measured even either way.
|
|
1323
|
+
// The UI's "Thinking…" timer keys off the empty thinking_delta emitted
|
|
1324
|
+
// when a thinking block opens, so it is unaffected.
|
|
1325
|
+
thinking: { type: "adaptive", display: "omitted" },
|
|
1323
1326
|
maxTokens,
|
|
1324
1327
|
outputConfig: { effort }
|
|
1325
1328
|
};
|
|
@@ -4936,10 +4939,11 @@ function registerPalsuProvider(config) {
|
|
|
4936
4939
|
},
|
|
4937
4940
|
state,
|
|
4938
4941
|
getModel(modelName) {
|
|
4939
|
-
|
|
4940
|
-
|
|
4942
|
+
let ms = modelStates.get(modelName);
|
|
4943
|
+
if (!ms) {
|
|
4944
|
+
ms = { responses: [] };
|
|
4945
|
+
modelStates.set(modelName, ms);
|
|
4941
4946
|
}
|
|
4942
|
-
const ms = modelStates.get(modelName);
|
|
4943
4947
|
return {
|
|
4944
4948
|
setResponses(r) {
|
|
4945
4949
|
ms.responses.length = 0;
|