feat: per-model max output tokens and a conversation-time thinking level backed by agent settings (#28)

Co-authored-by: Alice <alice@prismshadow.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
authored and GitHub committed 2026-07-22 22:22:41 +08:00
1 parent 99f391f379
commit cabbab1c16
36 files changed
+797 -42

No files matched your search

+3 -2
View File
@@ -3,7 +3,7 @@ name: penguin-cli
description: Manage model API keys, default models and per-agent vault secrets with the penguin CLI.
short_description: Manage models and secrets with the penguin CLI.
short_description_zh: 用 penguin CLI 管理模型与密钥。
version: 4
version: 5
updated: 2026-07-22T00:00:00Z
---
@@ -21,7 +21,7 @@ Add or update a model (upsert by the `(provider, model_id)` pair; re-run with mo
```bash
penguin config model add --provider <group> --model-id <upstream_id> [--api-key <key>] [--base-url <url>] \
[--client-type <type>] [--context-window <n>] [--vision | --no-vision] \
[--client-type <type>] [--context-window <n>] [--max-tokens <n>] [--vision | --no-vision] \
[--price-cache-read <n>] [--price-cache-write <n>] [--price-output <n>] \
[--project-id <id>] [--root <dir>] [--set-default]
```
@@ -30,6 +30,7 @@ penguin config model add --provider <group> --model-id <upstream_id> [--api-key
- For any OpenAI chat-completion compatible endpoint use `--client-type openai --base-url <endpoint>`; omit `--client-type` to auto-route by model id.
- Prices are USD per million tokens (cache read / cache write / output).
- `--vision` / `--no-vision` mark whether the model accepts images; omitting both keeps the current value (default is vision-capable).
- `--max-tokens <n>` pins a per-model output cap (positive integer), overriding the Agent's `model.max_tokens`; omit to inherit. Lower it for small-context models — the per-Agent default (32000) cannot fit into e.g. a 32k context window together with any prompt.
- All `penguin config model ...` and `penguin config vault ...` commands accept `--root <dir>` to target another data root (default `PENGUIN_HOME`, then `~/.penguin/data`). Two configuration targets — treat the difference as a hard rule:
- **Penguin's own model** (self-configuration: the model Penguin itself runs on): the default root without `--root` is correct.
- **An AI app you are building**: `--root` **must** point at the app's own data directory inside the project (e.g. `--root ./penguin_data`, the same path the app gives `createAgent({ root })`) unless the user explicitly chose another location — never write an app's models or keys into the global `~/.penguin/data`, which belongs to the person running Penguin, not to the app.