这篇博文本身就是 reasonix 自动完成的。
前两天在逛 GitHub 的时候,又看到 DeepSeek 生态里冒出来一个叫 Reasonix 的项目。第一眼感觉就是又一个 AI coding agent 套壳,没什么稀奇的。但当我看完它的 README 和工程文档后,发现这事儿没那么简单——尤其有意思的是它的核心理念:专为 DeepSeek 的前缀缓存(automatic prefix cache)设计,所有行为都围绕这个来优化,把长会话的 token 成本压到最低。
要知道 DeepSeek 有一个很厉害的特性——自动前缀缓存。如果你的请求前缀跟上一次完全一样(byte-stable),这部分 tokens 就不重新算,只算新内容的计算成本。这意味着 cache hit 的价格可以低到 ¥0.02/M tokens,而正常输入是 ¥1/M,差了 50 倍。Reasonix 整个架构就是奔着这个去的——系统提示词、工具描述、记忆文档,全链路保持字节稳定,永远不会在会话中途偷偷修改前缀。
1
2
3
4
|
npm install -g reasonix
reasonix setup
export DEEPSEEK_API_KEY=sk-xxxxxxxxxxxxxxxx
reasonix chat
|
这是我自己的环境,当时从源码编译的
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
#需要设置 go 代理
export GOPROXY=https://goproxy.cn,direct
git pull
git pull origin main-v
make build
make cross
cd ./dist/
./reasonix-linux-amd64
alias rs='~/git/DeepSeek-Reasonix/dist/reasonix-linux-amd64'
reasonix — a config- and plugin-driven coding agent (multi-model)
Usage:
reasonix chat [--model NAME] [-c|--continue] [--resume] interactive session (multi-turn; -c resumes the latest, --resume picks one)
reasonix run [--model NAME] [--max-steps N] [-c|--continue] [--resume PATH] <task> run one task and exit
reasonix serve [--model NAME] [--addr HOST:PORT] serve the session over HTTP+SSE (browser client at /)
reasonix acp [--model NAME] serve Agent Client Protocol over stdio (also: reasonix --acp)
reasonix setup [path] interactive config wizard; writes reasonix.toml (+ .env)
reasonix config auto-plan [off|on] configure automatic plan mode
reasonix mcp <add|remove|list> manage MCP servers in reasonix.toml
reasonix doctor [--json] print redacted local diagnostics
reasonix version
reasonix help
Examples:
reasonix chat
reasonix chat --continue
reasonix run "implement the TODOs in main.go"
reasonix run --model mimo-pro "add unit tests for this function"
echo "explain this code" | reasonix run
Configuration:
Resolution: flag > ./reasonix.toml > ~/.config/reasonix/config.toml > built-in defaults
Secrets come from the environment via api_key_env (e.g. DEEPSEEK_API_KEY).
Run 'reasonix setup' to scaffold a config; see docs/SPEC.md.
## 启动 server
reasonix serve
|