Junie
在 Junie CLI 中透過自訂模型 Profile 接入 aicentos
最後更新於:
Junie 是 JetBrains 的編碼代理,分為 IDE 外掛程式和 Junie CLI 兩種形態。只有 Junie CLI 支援指向自訂端點:它透過 $JUNIE_HOME/models/ 下的 JSON profile 接入任意 OpenAI 相容服務。IDE 外掛程式目前不能指向自訂端點。
準備工作
先在控制台「API Key」頁面為 Junie 建立一個專用 Key(建議命名 junie-cli)。
- 控制台:https://aicentos.com
- 建立 Key:https://aicentos.com/keys
- 錢包儲值:https://aicentos.com/wallet
需要填寫的設定
| 欄位 | 值 |
|---|---|
baseUrl | https://aicentos.com/v1/chat/completions |
apiType | OpenAICompletion |
apiKey | 控制台建立的 Key(支援 ${ENV_VAR} 引用) |
id | 控制台「模型廣場」中的模型名稱 |
displayName / providerName | 自訂,例如 aicentos |
注意:Junie 的 profile 與多數用戶端相反,baseUrl 需要填完整端點,必須以 /chat/completions 結尾,Junie 不會自動補路徑。
設定步驟
- 建立 profile 檔案(檔名去掉
.json就是 profile 識別碼):- 使用者級:
~/.junie/models/aicentos.json($JUNIE_HOME預設是~/.junie) - 專案級:
<專案根>/.junie/models/aicentos.json(需專案已受信任)
- 使用者級:
- 寫入以下內容:
{
"id": "gpt-5",
"baseUrl": "https://aicentos.com/v1/chat/completions",
"apiType": "OpenAICompletion",
"apiKey": "${AICENTOS_API_KEY}",
"displayName": "aicentos GPT",
"providerName": "aicentos",
"fasterModel": { "id": "gpt-5-mini" }
}- 匯出環境變數:
export AICENTOS_API_KEY="sk-你的aicentos密钥"- 啟動時指定 profile,或在互動介面裡用
/model選擇:
junie --model custom:aicentos測試
啟動後先用一句簡單提示詞輕量測試,確認能正常回傳結果再正式使用 agentic 工作流程。
注意事項
- JetBrains IDE 外掛程式不支援自訂端點,這套 profile 只在 Junie CLI 裡生效。
baseUrl必須是完整端點(含/v1/chat/completions),這與很多只需填 Base URL 的用戶端不同。apiKey與extraHeaders中的${VAR}在載入 profile 時解析;環境變數未設定會導致 profile 載入失敗。- 專案級 profile 受專案信任限制,未信任的專案會報
Unknown custom model profile。 - 小模型難以勝任 Junie 的多步工具呼叫與長上下文任務,建議選能力較強的模型。
- 更多說明見文件站:https://docs.aicentos.com