refactor: use a single agent model path

This commit is contained in:
wuyang
2026-07-26 18:50:51 +08:00
parent 2e8e81c790
commit d95d06233f
23 changed files with 330 additions and 454 deletions
+27 -30
View File
@@ -1,15 +1,8 @@
# K1412 Agent
K1412 Agent is a multi-user web Agent built around two deliberately different
experiences:
- **Chat** is fast, conversational, and uses Open WebUI's native tool loop.
- **Work** is a long-running coding Agent whose loop, scheduler, context,
memory, tools, and sub-agents are owned by this repository.
A conversation may be upgraded from Chat to Work. The upgrade is intentionally
one-way so that two independent Agent loops never compete for the same
conversation state.
K1412 Agent is a multi-user web coding Agent. Every user request enters the
same independently evolvable Agent loop; its scheduler, context policy, memory,
tools, evidence rules, and child Agents are owned by this repository.
The production instance is available at <https://agent.k1412.top>.
@@ -22,7 +15,7 @@ browser
Open WebUI (auth, RBAC, chat history, UI)
|
v
Agent Runtime (model gateway + Work loop)
Agent Runtime (model gateway + Agent loop)
|
v
Workspace Gateway (identity, policy, audit)
@@ -31,19 +24,24 @@ Workspace Gateway (identity, policy, audit)
one Docker workspace per Open WebUI user on a dedicated execution host
```
Open WebUI is pinned and lightly patched. Its model picker is replaced by two
product-level choices: `Chat / Work` and `轻度 / 中 / 高 / 极高`. Provider URLs,
provider model IDs, API keys, tool server settings, system prompts, and runtime
parameters remain server-side.
Open WebUI is pinned and lightly patched. Its picker exposes only four model
names and a separate read-only thinking status. Provider URLs, provider model
IDs, API keys, tool server settings, system prompts, and runtime parameters
remain server-side.
The inference mapping is fixed:
Model identity and thinking control are intentionally separate:
| Strength | Provider model |
| --- | --- |
| 轻度 | `ChatGPT-5.6:Luna` |
| | `ChatGPT-5.6:Terra` |
| | `ChatGPT-5.6:Sol` |
| 极高 | `deepseek-v4-pro`Thinking`reasoning_effort=max` |
| UI model | Provider model | Thinking | Reasoning effort |
| --- | --- | --- | --- |
| Luna | `ChatGPT-5.6:Luna` | On, no effort levels | — |
| Terra | `ChatGPT-5.6:Terra` | On, no effort levels | — |
| Sol | `ChatGPT-5.6:Sol` | On, no effort levels | — |
| DeepSeek V4 Pro | `deepseek-v4-pro` | On | Extreme (`max`) |
The three Ollama models advertise `thinking`, but they are Qwen-family models
with a boolean thinking switch rather than GPT-OSS-style low/medium/high
effort levels. Luna, Terra, and Sol are different models, not three reasoning
settings for one model.
## Local development
@@ -64,9 +62,8 @@ The inference mapping is fixed:
4. Open <http://localhost:3000>. New users register as `pending` and require
approval by the bootstrap administrator.
The pasted provider credential from the planning conversation is intentionally
not stored here. Rotate it and place the replacement only in the protected
deployment `.env`.
Provider credentials are intentionally not stored here. Keep them only in the
protected deployment `.env`.
## Tests
@@ -83,14 +80,14 @@ test, with:
./scripts/verify.sh
```
Run a live Work evaluation in a unique, disposable, network-disabled Docker
Run a live Agent evaluation in a unique, disposable, network-disabled Docker
workspace with:
```bash
set -a
source /path/to/protected/deepseek.env
set +a
.venv/bin/python scripts/eval-live-work.py --model work-extreme
.venv/bin/python scripts/eval-live-work.py --model deepseek-v4-pro
```
The evaluator reports latency, token usage, tool counts, completion evidence,
@@ -98,8 +95,8 @@ and the generated file listing. It removes only the uniquely named evaluation
container, volume, and network unless `--keep-workspace` is supplied.
Run the disposable six-service integration stack with a deterministic fake
model provider and exercise registration approval, both Agent loops, workspace
isolation, and the one-way mode upgrade with:
model provider and exercise registration approval, the Agent loop, workspace
isolation, and file delivery with:
```bash
./scripts/verify-e2e.sh
@@ -116,7 +113,7 @@ High/Critical image vulnerabilities, with:
./scripts/audit-images.sh
```
Generated files are available from the **工作区文件** button beside the mode
Generated files are available from the **工作区文件** button beside the model
selector. Users can browse directories, download one file, or download the
current directory as a `.tar.gz` archive. Browser requests are authenticated by
Open WebUI and re-signed for the Workspace Gateway; no internal key is exposed.