docs: drop leftover region-env notes from README
This commit is contained in:
@@ -6,10 +6,6 @@ A [pi](https://shittycodingagent.ai/) extension that connects pi to Qoder.
|
|||||||
pi install npm:pi-provider-qoder
|
pi install npm:pi-provider-qoder
|
||||||
```
|
```
|
||||||
|
|
||||||
The published package ships `dist/index.js` via `pi.extensions`.
|
|
||||||
|
|
||||||
Log in, then pick a provider and a model:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pi --provider qoder --model Lite
|
pi --provider qoder --model Lite
|
||||||
pi --provider qoder-cn --model Qwen3.7-Plus
|
pi --provider qoder-cn --model Qwen3.7-Plus
|
||||||
@@ -24,58 +20,31 @@ Inside pi:
|
|||||||
|
|
||||||
## Providers
|
## Providers
|
||||||
|
|
||||||
Both providers are always registered together. Each is bound to one region at
|
Both providers register together.
|
||||||
registration. There is no `QODER_REGION`, `QODER_BACKEND`, or `QODER_MODE`, and
|
|
||||||
those cannot reroute `qoder` to China. Use `--provider qoder-cn` instead.
|
|
||||||
|
|
||||||
### `qoder` (global)
|
### `qoder` (global)
|
||||||
|
|
||||||
- Always `https://api3.qoder.sh/`
|
- `https://api3.qoder.sh/`
|
||||||
- Login: `/login qoder` (browser OAuth or PAT)
|
- Login: `/login qoder` (browser OAuth or PAT)
|
||||||
- PAT page: https://qoder.com/account/integrations
|
- PAT page: https://qoder.com/account/integrations
|
||||||
- Env (first match): `QODER_API_KEY`, `QODER_PERSONAL_ACCESS_TOKEN`, `QODER_PAT`
|
- Env (first match): `QODER_API_KEY`, `QODER_PERSONAL_ACCESS_TOKEN`, `QODER_PAT`
|
||||||
|
|
||||||
### `qoder-cn` (China)
|
### `qoder-cn` (China)
|
||||||
|
|
||||||
- Always `https://gateway.qoder.com.cn/`
|
- `https://gateway.qoder.com.cn/`
|
||||||
- Login: `/login qoder-cn` (PAT only; no browser login)
|
- Login: `/login qoder-cn` (PAT only)
|
||||||
- PAT page: https://qoder.com.cn/account/integrations
|
- PAT page: https://qoder.com.cn/account/integrations
|
||||||
- Env (first match): `QODERCN_API_KEY`, `QODERCN_PERSONAL_ACCESS_TOKEN`, `QODERCN_PAT`
|
- Env (first match): `QODERCN_API_KEY`, `QODERCN_PERSONAL_ACCESS_TOKEN`, `QODERCN_PAT`
|
||||||
|
|
||||||
A PAT (`pt-...`) is exchanged for a short-lived job token (same as qodercli) and
|
A PAT (`pt-...`) is exchanged for a job token. Setting any of those env vars logs the provider in at startup.
|
||||||
re-exchanged when it expires. Setting any of the env vars above logs that
|
|
||||||
provider in automatically at startup.
|
|
||||||
|
|
||||||
## Models
|
## Models
|
||||||
|
|
||||||
Public model IDs are friendly names only: the catalog `display_name` with
|
Model IDs are the catalog `display_name` with whitespace stripped. After login, `/model` lists what that region offers.
|
||||||
whitespace stripped. After login, the live `/algo/api/v2/model/list` catalog
|
|
||||||
replaces the static fallback. Run `/model` to see what the region actually
|
|
||||||
offers.
|
|
||||||
|
|
||||||
Do not treat the static seeds as the live list; they go stale. Live CN currently
|
Examples: `Lite`, `Qwen3.8-Max`, `Qwen3.7-Plus`, `Qwen3.8-Flash`.
|
||||||
includes models such as Qwen3.8-Flash and Qwen3.7-Flash that the static catalog
|
|
||||||
may omit, and still lists some models that are gone live.
|
|
||||||
|
|
||||||
Examples (not exhaustive):
|
Context uses the largest live catalog option (often 1M). Output is 128K.
|
||||||
|
|
||||||
- Global `qoder`: `Lite`, `Qwen3.8-Max`, `Qwen3.7-Plus`
|
|
||||||
- China `qoder-cn`: `Qwen3.8-Flash`, `Qwen3.7-Plus`
|
|
||||||
|
|
||||||
Requests still send the internal upstream key (`lite`, `qfmodel`, …), but those
|
|
||||||
keys are not public IDs. `--model qfmodel` fails with `Unknown Qoder model id`.
|
|
||||||
`--model lite` as a raw key also fails; it can still work only because pi
|
|
||||||
case-insensitively matches the friendly id `Lite`.
|
|
||||||
|
|
||||||
Context window uses the largest option the live catalog advertises (often 1M).
|
|
||||||
Output is capped at 128K tokens.
|
|
||||||
|
|
||||||
## 0.4 breaking changes
|
|
||||||
|
|
||||||
- Model IDs are friendly names only. Raw upstream keys are not public IDs.
|
|
||||||
- Providers are region-bound: `qoder` is always global, `qoder-cn` is always CN.
|
|
||||||
`QODER_REGION` is gone.
|
|
||||||
- The published extension entry is `dist/index.js` (fixes npm packages that pointed at src).
|
|
||||||
|
|
||||||
## Endpoints
|
## Endpoints
|
||||||
|
|
||||||
@@ -86,29 +55,6 @@ Output is capped at 128K tokens.
|
|||||||
| Usage | `https://openapi.qoder.sh/api/v2/quota/usage` | `https://openapi.qoder.com.cn/api/v2/quota/usage` |
|
| Usage | `https://openapi.qoder.sh/api/v2/quota/usage` | `https://openapi.qoder.com.cn/api/v2/quota/usage` |
|
||||||
| Chat gateway | `https://api3.qoder.sh/` | `https://gateway.qoder.com.cn/` |
|
| Chat gateway | `https://api3.qoder.sh/` | `https://gateway.qoder.com.cn/` |
|
||||||
|
|
||||||
## Architecture
|
|
||||||
|
|
||||||
```text
|
|
||||||
src/
|
|
||||||
├── index.ts # Register both providers
|
|
||||||
├── region.ts # Fixed global/CN URLs and env names
|
|
||||||
├── catalog.ts # Friendly IDs, live catalog cache, static seeds
|
|
||||||
├── cosy.ts # Internal request signing
|
|
||||||
├── auth/
|
|
||||||
│ ├── pat.ts # PAT → job-token exchange
|
|
||||||
│ ├── login.ts # Browser/PAT login
|
|
||||||
│ ├── oauth.ts # Credentials, refresh, env auto-login
|
|
||||||
│ └── usage.ts # Quota reporting
|
|
||||||
└── protocol/
|
|
||||||
├── stream.ts # Streaming request/response
|
|
||||||
├── transform.ts # Message conversion
|
|
||||||
├── encoding.ts # Internal body encoding
|
|
||||||
└── thinking.ts # Thinking-tag parser
|
|
||||||
```
|
|
||||||
|
|
||||||
COSY signing and WAF body encoding are internal request plumbing, not
|
|
||||||
user-facing features.
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
MIT
|
MIT
|
||||||
|
|||||||
Reference in New Issue
Block a user