release: dsh-infstarapi 0.2.0
CI / test (push) Canceled after 0s

This commit is contained in:
Coldsmile_7 committed 2026-11-26 08:24:56 +08:00
1 parent a8f689e39c
commit c340aec110
59 files changed
+1108 -1590

No files matched your search

+28 -52
View File
@@ -1,75 +1,51 @@
<div align="center">
# DSH InfStarAPI
<img src="docs/assets/dsh-geek2api-mascot.png" width="200" height="200" alt="Geek2API">
![InfStarAPI](docs/assets/dsh-geek2api-mascot.png)
# DSH Geek2API
[简体中文](README.md) · **English**
**Use Geek2API API keys in DeepSeek Harness: pick models, rotate keys, see balances.**
Installing it adds a `Geek2API` group to the model picker. No YAML and no provider setup.
</div>
Use the InfStarAPI relay from DeepSeek Harness with a dedicated GPT and DeepSeek model route.
## Features
| Capability | What you get |
| --- | --- |
| **Built-in model route** | A `Geek2API` picker group with Claude, GPT, DeepSeek, Grok, Gemini, GLM, and Kimi |
| **Multi-endpoint failover** | The hk / hk2 / hk3 / hk4 / www entry points are measured and the fastest is used; one that cannot be reached is skipped and the retry goes to the next |
| **Several keys in order** | An exhausted, disabled, or rejected key hands over to the next usable key |
| **Per-key model choice** | Each key lists the models it can use (✓ / ✕); a turn whose model the active key cannot use runs on a key that can |
| **Balances at a glance** | Remaining balance, today's spend, subscription window or key quota per key; keys of one account share a wallet and count once; the composer shows the active key's remaining balance |
| **Two Claude runtimes** | HTTP by default (DSH's own tools and permissions), or the local official Claude Code CLI |
| **Optional web search** | DSH's `web_search` can search through Geek2API (Claude or GPT backend) |
| **Credentials stay local** | Keys live only in the DSH credentials file; the browser sees labels, state, and balances |
- Default API origin: `https://sub.infstar.org`; override it in Settings → InfStarAPI.
- Built-in models: `gpt-6.1-sol`, `gpt-6.2-sol`, `gpt-6.2-astra`, `deepseek-v4.1-flash`, and `deepseek-v4-pro`.
- Multiple API keys, per-key model coverage from `/v1/models`, and sub2api balance reads from `/v1/usage`.
- InfStarAPI uses separate plugin, provider, settings, credential, RPC, browser-slot, and search-provider IDs, so it can coexist with `dsh-geek2api`. Keys are separate and must be added to each plugin independently.
- API keys remain in DSH Host credential storage and never reach the browser.
## Install
1. In the desktop app, open **Plugins → Add plugin**, enter `dsh-geek2api` with the official registry (within 24 hours of a release the bundled pnpm refuses it by name; use the mirror address then), or enter `https://hk.geek2api.com/dsh/dsh-geek2api.tgz` (Geek2API's mirror of the GitHub release, reachable from mainland networks; synced every 10 minutes) or `https://github.com/CoderKuo/dsh-geek2api/releases/latest/download/dsh-geek2api.tgz`, and install. No restart is needed for a first install. You can also download the `.tgz` from [Releases](https://github.com/CoderKuo/dsh-geek2api/releases) and install it from a local path.
2. Open **Settings → Geek2API** and paste an API key (create one under API Keys in the Geek2API console). Add more keys for other groups; the plugin picks the right one per model.
3. Pick a model under the `Geek2API` group.
This repository does not yet have a release download or automatic update endpoint. Build a local package:
## Daily use
```sh
pnpm install --frozen-lockfile
pnpm run check
```
- **Models per key.** Under each key, ✓ / ◐ / ✕ per model family, read from that key's `/v1/models` (free). When no stored key can use the selected model the turn says so instead of retrying.
- **Balance.** Wallet (shared by an account's keys, counted once), the tightest subscription window, or the key's own quota and 5h/1d/7d windows, plus today's spend. Refresh skips the 60-second cache.
- **Endpoints.** The Endpoints card shows each entry point's latency and state. Hosts are re-measured every 10 minutes; a host that fails in transit (DNS, TLS, timeout, reset) is skipped for 2 minutes and the failed step retries on the next one. You can re-measure or edit the list (one per line; empty restores the defaults).
- **Claude runtime.** In the Claude Code CLI card: HTTP (default, recommended) or the local Claude Code CLI (one-click install; needs Node.js 18+, and Git for Windows on Windows). The `claude_code` delegation tool works either way.
- **Web search.** Settings → Geek2API → Web search: leave DSH alone (default), search through Geek2API for Geek2API models only, or always. Backend: Claude (`claude-haiku-4-5-20251001`, default, about 10K tokens per search) or GPT (`gpt-6.1-sol`, about 20–30K). DeepSeek groups drop the server search tool, so they are not offered.
In DSH, open **Plugins → Add plugin** and install `.artifacts/dsh-infstarapi-0.2.0.tgz` from a local file. Then open **Settings → InfStarAPI** and add an API key for your relay.
Keys rotate on `余额不足,请充值`, a lapsed subscription, `Invalid API key`, `API key is disabled`, `API key 已过期`, or `API Key 所属分组已删除`. Rate limits (429) and upstream 5xx do not rotate keys; they are retried.
## Models and APIs
## Models
| Model ID | Protocol |
| --- | --- |
| `gpt-6.1-sol` | OpenAI Responses |
| `gpt-6.2-sol` | OpenAI Responses |
| `gpt-6.2-astra` | OpenAI Responses |
| `deepseek-v4.1-flash` | OpenAI Chat Completions |
| `deepseek-v4-pro` | OpenAI Chat Completions |
| Model | Protocol | Efforts |
| --- | --- | --- |
| `claude-opus-5-5`, `claude-sonnet-5-5` | Messages | low / medium / high / xhigh / max |
| `claude-haiku-4-5-20251001` | Messages | low / medium / high |
| `gpt-6.1-sol`, `gpt-6-astra`, `gpt-6-luna` | Responses | low / medium / high / xhigh / max |
| `deepseek-v4.1-flash`, `deepseek-v4-pro` | Chat Completions | off; low / high / max |
| `grok-4.6`, `grok-4.7` | Responses | low / medium / high / xhigh |
| `gemini-3.8-flash`, `glm-5.3`, `kimi-k3` | Chat Completions | none |
GPT 6.2 context and output limits currently reuse the GPT 6.1 values and have not been verified against the relay. If `/v1/models` uses different IDs, add them under **Settings → InfStarAPI → Visible models → Custom models**.
Whether a key can use a model depends on its group; trust the ✓ / ✕ in settings.
Model requests use the selected protocol's `/v1` endpoint. Balance uses sub2api's `/v1/usage?lite=1`; model coverage uses `/v1/models`. Requests are time-bounded and refuse redirects. Additional gateway origins can be configured one per line under **Settings → InfStarAPI → Endpoints**.
**Custom models.** A model Geek2API serves but the table lacks can be added by id under **Settings → Geek2API → Visible models → Custom models**: the model id (as the key's `/v1/models` lists it; not a built-in id), an optional display name, the protocol (Chat Completions by default; Messages for Claude, Responses for GPT and Grok), whether it reasons (then off / low / medium / high are offered), whether it takes images, and optionally its context window and max output (default 128000 / 32000). It appears in the picker at once, with the same key rotation and endpoint failover, and a "Custom" column under each key shows whether that key reaches it. Up to 32. A session using a removed custom model fails with an unknown model instead of switching to another one.
## Update and uninstall
The version card in **Settings → Geek2API** checks the Geek2API mirror first and GitHub when no mirror answers; update from there, then fully quit and reopen the desktop app. Before uninstalling, set web search back to "leave DSH alone" if you used it, then uninstall from the Plugins page and restart.
## Security
Requests go to Geek2API's endpoints. Keys are stored in `~/.dsh/.credentials.yaml` (owner-only) and never reach settings documents, logs, transcripts, or the browser. Balance and model-list reads are host-side, time-bounded, and refuse redirects. See [SECURITY.md](SECURITY.md).
Web search is limited to the retained GPT Responses backend. The in-plugin update card is disabled until a release endpoint for the self-hosted repository is configured.
## Development
```sh
pnpm install --frozen-lockfile
pnpm run check
node scripts/smoke.mjs keys.json # {"label": "sk-…"}; prints labels only
```
Derived from [dsh-packycode-api](https://github.com/BaronCyrus/dsh-packycode-api) (MIT). License: [MIT](LICENSE).
A live gateway check requires an InfStarAPI API key: `node scripts/live-check.mjs`. It consumes a small amount of quota and has not been run for this fork.
This fork is based on [dsh-geek2api](https://github.com/CoderKuo/dsh-geek2api) and retains its MIT license; see [LICENSE](LICENSE).