跳到主內容

Theme / 0.3.2

ThinkRail

圍繞 pi 代理的代理式 IDE

基礎觀念

供應商與模型:JetBrains AI 或自帶,沒有第三種帳號

🔴 進階|ThinkRail 沒有自己的帳號體系:登入 JetBrains AI,或用 pi 原生的 provider 設定。JetBrains AI 走你自己的 central CLI;自架 OpenAI-compatible 伺服器(Ollama、vLLM…)從 Settings → Providers 加,存進 pi 的 models.json。

原則:自己的帳號,自己的憑證

README〈What you get · Your providers, your credentials〉:

Sign in with JetBrains AI or connect any provider through pi’s own auth. ThinkRail has no accounts of its own.

模型供應只有兩條路:JetBrains AI 或你自己的 provider。帳號與 token 都在你的 pi 設定(~/.pi/agent)裡,ThinkRail 只是讀;專案的架構目標文件也明言「ThinkRail keeps no accounts or tokens of its own」。

JetBrains AI:走你自己的 central CLI

供應商整合文件(docs/central-integration.md)說明:JetBrains AI 的接入不是 ThinkRail 內建模組,而是使用者機器上自己的 central CLI 做:

  • 寫入一支 pi extension,把 JetBrains AI 註冊成 provider
  • 回報 AI-credit quota(central quota --json 輪詢)

所以解除 ThinkRail 不會弄髒你的授權——它本來就不持有。README 安裝段也只說:thinkrail needs git on your PATH and a model provider — sign in with JetBrains AI from the app or use your own provider credentials.

自架 OpenAI-compatible 伺服器

v0.3.1 起(#1084):feat: connect your own OpenAI-compatible model servers from Settings → Providers。README 對流程的描述:

Settings → Providers → Custom servers connects a company LLM gateway or a model running on your own machine — any OpenAI-compatible server, such as LiteLLM, sglang, vLLM, Ollama, LM Studio or llama.cpp. Find models lists what the server serves, with the context and capabilities it reports. The server is saved to pi’s models.json, so its models appear in the chat model picker and in the pi CLI alike.

步驟 動作
1 Settings → Providers → Custom servers,填 base URL 等連線資訊
2 Find models 掃出伺服器提供的模型,附伺服器回報的 context 與能力
3 選用的伺服器存進 pi 的 models.json
4 之後在 chat model picker 與 pi CLI 都看得到

實戰範例見連接 Ollama 模型伺服器。

環境變數與 pi 目錄

README〈Your pi setup〉:

ThinkRail reads your existing pi configuration (~/.pi/agent). To use another one — say a personal ~/.pi/agent-personal — or to pass extra environment variables to the agent, terminals and MCP servers, set them in Settings → Environment; they apply on the next start. A variable you set when launching (PI_CODING_AGENT_DIR=… thinkrail) still wins.

  • Settings → Environment:幫代理、終端機、MCP 統一設環境變數
  • 換 pi 目錄:想讓 ThinkRail 用另一份 pi 設定,直接指向別的 config dir
  • 啟動參數覆寫:PI_CODING_AGENT_DIR=… thinkrail 優先於 Settings 設定
  • 變更下次啟動生效

每個對話自選模型

官網首頁能力卡:Per-session model choice——同一工作區的多個對話可以各用不同模型(呼應 對話課 的 live token/cost readout)。v0.3.2 修正讓新對話正確沿用 pi 設定的預設模型:fix(server): use pi's configured default model for new chats(#1161)。

下一課

介面調校:客製化 ThinkRail。