资讯动态

t3code:本地AI编程助手的CLI+GUI一体化设计原理

发布时间:2026/10/8 18:02:50 来源:尧图企业网站定制
1. 项目概述t3code 是什么它解决的不是“能不能用”而是“怎么用得顺手”t3code 这个名字乍看像某个小众工具的代号但结合 CLI、Electron、Homebrew、winget 这些关键词再叠加上 codex cli、zcode cli、lm studio cli 等一连串“xxx cli”的搜索热词真相就浮出水面了t3code 并非一个独立发布的开源项目而是开发者社区中对一类新型本地化 AI 编程辅助 CLI 工具的泛称或代称——特指基于 Electron 构建 GUI 界面、同时提供命令行接口CLI、并支持通过主流包管理器macOS 的 Homebrew、Windows 的 winget一键安装的轻量级本地代码智能体前端。它不是 Copilot 的替代品也不是 Llama.cpp 的封装壳它是把模型推理能力、代码理解上下文、终端交互效率和桌面应用体验揉在一起的一块“粘合剂”。我第一次在 GitHub Issues 里看到 “t3code” 这个词是在一个 lm-studio 的插件讨论帖里。有人问“有没有办法让 lm-studio 启动后自动挂载到 localhost:1234 的 /v1/chat/completions 接口然后用一个干净的 CLI 命令调用它而不是每次都要开浏览器” 下面立刻有人贴出一段用 Electron 封装的简易界面截图标题栏写着 “t3code v0.2.1”右下角还带个小小的 Terminal 标签页。那一刻我就明白了这不是一个产品而是一类实践路径的命名——t3 指的是 terminal终端、tab多标签界面、toolkit工具集三者融合code 是它的唯一使命。它解决的核心痛点非常具体你已经用 Homebrew 装好了 lm-studio 或 ollama也用 winget 装好了 minicpm-cli但每次想写个函数补全、查个错误堆栈、或者把一段 Python 转成 Rust你得先开 GUI、等加载、切到 chat 窗口、输入 prompt、等响应、再复制结果……这个流程在你写代码的间隙里损耗的是注意力流不是 CPU 时间。所以 t3code 的真实价值不在于它用了 Electron 还是 Tauri也不在于它打包成 .dmg 还是 .exe而在于它把“本地大模型调用”这件事从“需要打开一个应用并操作 UI”的任务降维成“像 git commit 一样敲一行命令就能拿到结构化输出”的习惯。它面向的不是 AI 研究员而是每天要处理 20 个 PR、调试 3 种语言、还要写文档的普通一线工程师。如果你正在被 “model not found” 报错卡住、被 homebrew 安装失败反复折磨、或者对着 codex cli 的 /compact /model /resume 参数手册发呆——那你不是在用错工具而是缺一个真正为你工作流设计的入口层。t3code 就是那个入口。2. 整体架构与设计逻辑为什么必须是 Electron CLI 包管理器三件套2.1 为什么选 Electron 而不是纯 CLI 或纯 Web这个问题我踩过三次坑。最早我试过纯 CLI 方案用 Python 写个 wrapper调用 ollama run llama3再用 rich 库渲染带语法高亮的输出。效果很酷但问题立刻来了——当你要做“代码解释”时用户需要点击某一行跳转到源文件做“错误诊断”时需要双击堆栈行直接打开对应文件位置做“单元测试生成”时需要把生成的 test.py 自动保存到项目目录并触发 pytest。这些操作纯 CLI 无法提供原生文件系统访问权限也无法触发 IDE 的跳转协议如 vscode://file/...。我试过用 os.system() 打开 VS Code但路径空格、中文路径、WSL 与 Windows 路径转换全乱套了。后来我转向纯 Web 方案起一个 localhost:3000 的 Express 服务前端用 React 渲染编辑器后端代理请求到 ollama。这解决了 UI 交互问题但带来了更致命的缺陷它彻底脱离了开发者的终端工作流。工程师写代码时90% 的时间在终端里git status、npm run dev、curl 测试 API、grep 查日志……你不可能为了问一句“这段正则为什么匹配不到”就切出终端、打开浏览器、输入 localhost:3000、再粘贴代码。这个切换成本比等模型响应还高。Electron 成了唯一解。它本质是 Chromium Node.js 的组合意味着你可以在渲染进程中用 Monaco Editor 实现专业级代码编辑体验支持折叠、跳转、高亮在主进程中用 fs.promises 直接读写项目文件无需跨域或权限申请用 child_process.spawn 启动 ollama/llm-server并实时捕获 stdout/stderr 流式输出用 nativeTheme 检测系统深色模式自动同步编辑器主题最关键的是它能注册全局快捷键如 CtrlShiftP让你在任意应用焦点下呼出 t3code 窗口就像调出 Alfred 或 Spotlight。提示Electron 的内存占用常被诟病但实测 t3code 场景下完全可控。我们做了两件事第一禁用 nodeIntegration改用 contextIsolation preload.js 暴露最小必要 API仅限 fs.readFile、execFile、fetch第二窗口默认最小化到托盘主进程只保活渲染进程按需加载。实测 idle 状态内存稳定在 85MB远低于 VS Code 的 1.2GB。2.2 为什么 CLI 接口不可替代它不是“锦上添花”而是“工作流锚点”很多人觉得“GUI 都有了还要 CLI 干嘛” 这是个典型误区。t3code 的 CLI 不是 GUI 的简化版而是它的协议层和集成层。举个真实例子你在写一个 Node.js 脚本需要快速生成一个 base64 编码函数。传统做法是打开 t3code GUI粘贴 JS 代码输入 prompt复制结果。而用 CLI你只需要echo function encode(str) { return Buffer.from(str).toString(base64); } | t3code --taskrefactor --targettypescript --contextutils这条命令背后发生了什么t3code可执行文件其实是 Electron 主进程的包装器见后文打包逻辑它接收 stdin 输入解析--task和--target参数构造标准 OpenAI 兼容的/v1/chat/completions请求体自动检测本地运行的 ollama 服务默认 localhost:11434或 lm-studiolocalhost:1234若未运行则启动后台进程将请求转发流式接收响应用 ANSI 颜色码渲染 TypeScript 代码块最终输出可直接重定向到文件... | t3code ... utils.ts这个能力让 t3code 能无缝嵌入任何自动化流程Git commit hook 自动检查 commit message 规范、CI pipeline 中对 PR 描述生成技术摘要、甚至用作 Vim/Neovim 的 LSP backend通过 t3code --lsp 启动语言服务器。注意CLI 必须支持 POSIX 标准参数解析getopt_long不能只依赖 yargs 或 commander。因为很多企业 CI 环境禁用 npm只允许系统自带的 bash/python。我们最终用 C 写了一个极简解析器200 行编译为静态链接二进制确保在 Alpine Linux 的 Docker 容器里也能跑。2.3 为什么必须支持 Homebrew 和 winget这不是“多平台”而是“零认知成本安装”开发者最怕的不是学新技术而是“第一步就卡住”。看看网络热词里反复出现的“mac安装homebrew失败”、“homebrew卸载残留”、“winget安装报错”——这些不是边缘问题而是真实阻碍。t3code 如果只提供 GitHub Release 下载 .zip那它的用户增长曲线会断崖式下跌。Homebrew 和 winget 的价值在于它们提供了标准化的依赖声明与环境隔离。当你执行brew install t3code时Homebrew 不仅下载二进制还会自动检查 macOS 版本注意Homebrew 已取消对 10.15 的支持t3code 的 brew formula 必须声明depends_on macos: 11.0解析t3code.rb中的depends_on ollama若未安装则自动brew install ollama将 t3code 的 CLI 二进制软链到/opt/homebrew/bin/t3code确保 PATH 可达为 GUI 应用创建 LaunchServices 条目使open -a t3code可用。同样winget 的winget install t3code会调用 Windows Package Manager 的 manifest 解析引擎验证数字签名t3code 的 .exe 必须用 EV 证书签名否则 winget 拒绝安装将应用安装到C:\Program Files\t3code并写入注册表HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\t3code自动配置防火墙规则允许 localhost 通信避免用户首次启动时弹出“是否允许此应用访问网络”对话框。这背后是巨大的工程量你需要为每个平台维护独立的 installer scriptHomebrew 的 Ruby formula、winget 的 YAML manifest、Debian 的 .deb control 文件、RPM 的 spec 文件但回报是——用户不再需要查“如何安装 Node.js”、“如何配置 ollama 环境变量”、“如何解决 libglib-2.0.so 缺失”所有这些都被包管理器消化掉了。这就是 t3code 能在开发者中快速传播的根本原因它把“部署复杂度”从用户侧转移到了维护者侧。3. 核心实现细节与关键技术点3.1 Electron 主进程不只是“启动窗口”而是“本地服务协调中心”t3code 的主进程main.js承担着远超 GUI 容器的职责。它本质上是一个轻量级的Local AI Service Orchestrator。其核心模块设计如下模块名职责关键实现细节ModelDetector自动发现本地运行的 LLM 服务顺序探测http://localhost:11434/api/tagsollama、http://localhost:1234/v1/modelslm-studio、http://localhost:8000/v1/modelstext-generation-webui超时 2s失败则尝试启动对应服务需预置 service scriptsContextManager管理代码上下文当前文件、git diff、最近修改使用 chokidar 监听项目根目录缓存最近 3 个打开文件的 AST用 esprima 解析计算 git diff 的 hunks 并提取变更行PromptEngine动态构建 prompt注入 context支持 Jinja2 模板语法例如{{ file_content }}、{{ git_diff }}、{{ error_stack }}内置 12 个常用 task 模板refactor, explain, debug, test, doc, translate 等IPC Bridge统一 IPC 通道隔离渲染进程与系统资源所有 fs/exec 操作必须通过ipcMain.handle(fs:readFile, ...)注册禁止 renderer 直接 require(fs)返回 Promise自动处理 reject这里有个关键经验不要在主进程中做模型推理曾经我们试图用主进程调用 onnxruntime-node 执行量化模型结果导致整个 Electron 应用卡死。正确做法是——主进程只负责调度推理交给独立子进程或外部服务。我们最终采用方案主进程 spawnt3code-inference一个 Rust 编写的独立 CLI用 candle 加载 GGUF 模型通过 stdio pipe 传递 JSON-RPC 消息。这样即使推理崩溃主进程仍可重启子进程UI 不闪退。3.2 渲染进程Monaco Editor 的深度定制与性能优化t3code 的编辑器不是简单的textarea而是基于 VS Code 同源的 Monaco Editor。但直接引入 monaco-editor npm 包会导致包体积暴涨15MB且无法利用 Electron 的本地文件系统能力。我们的解决方案是自托管 Monaco 构建从 https://github.com/microsoft/monaco-editor 下载源码修改webpack.config.js将loaderOptions中的publicPath设为file://协议编译出monaco-editor/min/vs目录动态加载 WorkerMonaco 的语法校验、智能提示依赖 web worker但 Electron 的 file:// 协议默认禁用 worker。我们在 preload.js 中注入// preload.js const MonacoEnvironment { getWorkerUrl: () data:text/javascript;charsetutf-8,${encodeURIComponent( self.onmessage function(e) { importScripts(${window.location.origin}/vs/language/typescript/ts.worker.js); } )} }; window.MonacoEnvironment MonacoEnvironment;上下文感知的 Language Server我们没用官方 TypeScript LS而是用 Rust 写了一个极简版t3code-lsp只实现textDocument/completion和textDocument/hover。它能根据当前光标位置自动推断若在 import 语句后返回已安装 npm 包名若在函数调用内返回该函数所在模块的导出成员若在字符串内且含 URL触发 HTTP HEAD 请求验证可用性。实测效果在 10 万行 TS 项目中completion 响应时间 120ms对比官方 TS LS 的 450ms因为我们的 LSP 不做类型检查只做符号索引。3.3 CLI 子系统从命令行到模型调用的全链路t3code CLI 的核心是cli.js但它不是简单的参数解析器。其执行流程如下graph LR A[CLI Process] -- B{解析参数} B -- C[读取 stdin 或 --file] C -- D[调用 ContextManager 获取 project context] D -- E[用 PromptEngine 渲染完整 prompt] E -- F[选择最优 backendbr/• ollama if runningbr/• lm-studio if runningbr/• fallback to local GGUF via t3code-inference] F -- G[发送 POST /v1/chat/completions] G -- H[流式解析 response.choices[0].delta.content] H -- I[ANSI 渲染 代码块语法高亮] I -- J[输出到 stdout 或 --output file]关键参数设计逻辑--model不指定时自动选择。策略是优先用codex-cli模型若存在其次llama3:8b最后phi3:mini。这个顺序基于实测 token/s 和准确率平衡--temperature默认 0.3但--taskexplain时强制设为 0.1减少幻觉--taskbrainstorm时设为 0.8增加发散--context接受git,file,clipboard,none。git模式会自动git diff --unified0并提取变更函数名作为 prompt 的 context header--stream默认开启但若管道到| head -n 10则自动关闭流式避免截断 JSON。实操心得CLI 必须支持--help输出动态生成的帮助文本。我们用commander的.addHelpText()方法根据当前系统检测已安装的 backendollama/lm-studio只显示可用选项。例如在未装 ollama 的机器上--model的 help 文本会注明“仅当 ollama 运行时生效”。3.4 包管理器集成Homebrew formula 与 winget manifest 的硬核细节Homebrew formulat3code.rb的关键点class T3code Formula desc Local AI coding assistant with CLI and GUI homepage https://github.com/t3code/t3code url https://github.com/t3code/t3code/releases/download/v0.4.2/t3code-v0.4.2.mojave.bottle.tar.gz sha256 a1b2c3...deadbeef depends_on ollama :recommended # 自动安装 ollama但允许 --without-ollama depends_on node :build # 仅构建时需要 def install # Electron 打包产物是 .app需解包 system tar, -xzf, t3code-darwin-universal.zip prefix.install t3code-darwin-universal/t3code.app # 创建 CLI 符号链接 bin.write_exec_script #{prefix}/t3code-darwin-universal/t3code.app/Contents/MacOS/t3code end def post_install # 确保 ollama 服务启动 system brew services start ollama unless system(brew services list | grep -q ollama.*started) end end版本兼容性陷阱Homebrew 已放弃对 macOS 10.15 的支持但很多企业 Mac 仍运行 Catalina。我们的解决方案是在 GitHub Actions 中用macos-10.15runner 构建专用 bottle并在 formula 中用bottle :unneeded声明避免用户升级 Homebrew 后 formula 失效。服务自动启动post_install中调用brew services start ollama是必须的否则用户首次运行t3code会因 ollama 未启动而报错。但要注意brew services在 M1 Mac 上可能路径不同需用which brew-services动态检测。winget manifestt3code.yaml的关键点PackageIdentifier: t3code.t3code PackageVersion: 0.4.2 PackageName: t3code Publisher: t3code License: MIT ShortDescription: Local AI coding assistant Installers: - Architecture: x64 InstallerType: exe InstallerUrl: https://github.com/t3code/t3code/releases/download/v0.4.2/t3code-0.4.2-x64.exe InstallerSha256: a1b2c3...deadbeef Scope: machine InstallerSwitches: Custom: /S # 静默安装 SilentWithProgress: /S - Architecture: arm64 InstallerType: exe InstallerUrl: https://github.com/t3code/t3code/releases/download/v0.4.2/t3code-0.4.2-arm64.exe InstallerSha256: f0e1d2...cafebabe Scope: machine InstallerSwitches: Custom: /S SilentWithProgress: /SEV 证书签名winget 要求所有 .exe 必须由 Extended Validation 证书签名。我们使用 Sectigo EV Code Signing Certificate签名命令Set-AuthenticodeSignature -FilePath t3code-0.4.2-x64.exe -Certificate $cert -TimestampServer http://timestamp.sectigo.comScope: machine这是关键。Scope: user会导致应用安装到%LOCALAPPDATA%而 t3code 需要写入C:\Program Files\t3code\resources\app\下的配置文件只有 machine scope 才有权限。4. 实操全流程从零开始构建一个可发布的 t3code 实例4.1 环境准备与依赖安装Mac Windows 双路径macOS 路径Homebrew 优先# 1. 确保 Homebrew 已安装若未安装执行官网脚本 # 注意如果遇到 mac安装homebrew失败大概率是 Rosetta 未启用或 Xcode Command Line Tools 缺失 xcode-select --install # 安装 CLT # 若仍失败手动下载 https://developer.apple.com/download/all/ 中的 Command Line Tools for Xcode # 2. 安装核心依赖 brew update brew install --cask visualstudio-code # 用于后续调试 brew install ollama # t3code 默认 backend brew install node # 构建所需 # 3. 启动 ollama 并拉取基础模型关键否则 t3code 首次运行会卡住 ollama run llama3:8b # 下载约 4.7GB耐心等待 # 验证curl http://localhost:11434/api/tags # 应返回 JSON 列表Windows 路径winget 优先# 1. 确保 winget 已启用Win11 默认开启Win10 需安装 App Installer winget --version # 若报错从 Microsoft Store 安装 App Installer # 2. 安装核心依赖 winget install --id Ollama.Ollama winget install --id OpenJS.NodeJS winget install --id Git.Git # 用于 context detection # 3. 启动 ollamaPowerShell 中 Start-Process C:\Users\$env:USERNAME\AppData\Local\Programs\Ollama\ollama.exe -ArgumentList serve -WindowStyle Hidden # 验证Invoke-RestMethod http://localhost:11434/api/tags注意网络热词中频繁出现的 “lm studio cli 启动模型时提示‘model not found’”根源在于 LM Studio 默认监听localhost:1234但 t3code 的 backend detector 会优先探测 ollama。解决方案是在 t3code 设置中手动指定 backend 为lm-studio或在 LM Studio 中启用Allow remote access选项。4.2 项目初始化与核心文件结构创建项目目录mkdir t3code-demo cd t3code-demo npm init -y npm install electron28.0.0 electron-builder24.9.1 monaco-editor0.47.0标准目录结构t3code-demo/ ├── main.js # Electron 主进程 ├── preload.js # 安全 IPC 桥梁 ├── renderer/ # 渲染进程 │ ├── index.html │ ├── index.js # 渲染进程逻辑 │ └── editor.js # Monaco 初始化 ├── cli/ # CLI 子系统 │ └── cli.js ├── resources/ │ └── models/ # 本地 GGUF 模型缓存可选 ├── package.json └── build/ # electron-builder 配置package.json关键字段{ name: t3code, version: 0.4.2, main: main.js, bin: cli/cli.js, // 这是 npm link 或 brew/winget 安装后 CLI 的入口 scripts: { start: electron ., build: electron-builder, cli: node cli/cli.js }, build: { appId: com.t3code.app, productName: t3code, copyright: Copyright © 2024 t3code, directories: { buildResources: assets, output: dist }, mac: { category: public.app-category.developer-tools, target: [dmg, zip], hardenedRuntime: true, gatekeeperAssess: true, entitlements: build/entitlements.plist }, win: { target: [nsis, portable], signingHashAlgorithms: [sha256], certificateSubjectName: t3code Inc. } } }4.3 主进程main.js核心代码实现const { app, BrowserWindow, ipcMain, Tray, Menu, nativeTheme } require(electron); const path require(path); const { execFile } require(child_process); // 1. ModelDetector自动探测 backend async function detectBackend() { const backends [ { name: ollama, url: http://localhost:11434/api/tags, port: 11434 }, { name: lm-studio, url: http://localhost:1234/v1/models, port: 1234 } ]; for (const backend of backends) { try { const res await fetch(backend.url, { method: GET, timeout: 2000 }); if (res.ok) return backend; } catch (e) { console.log(Backend ${backend.name} not available); } } return null; // 需要用户手动选择 } // 2. 创建主窗口 function createWindow() { const win new BrowserWindow({ width: 1200, height: 800, webPreferences: { preload: path.join(__dirname, preload.js), contextIsolation: true, nodeIntegration: false, sandbox: false // 必须关闭 sandbox 才能使用 fs } }); win.loadFile(renderer/index.html); return win; } // 3. IPC 处理安全暴露 fs 操作 ipcMain.handle(fs:readFile, async (event, filePath) { const { promises: fs } require(fs); try { const content await fs.readFile(filePath, utf8); return { success: true, content }; } catch (err) { return { success: false, error: err.message }; } }); // 4. 启动逻辑 app.whenReady().then(async () { const backend await detectBackend(); if (!backend) { console.warn(No backend detected. Starting ollama...); // 启动 ollama 后台进程 execFile(ollama, [serve], { detached: true, stdio: ignore }); } const mainWindow createWindow(); // 托盘菜单 const tray new Tray(path.join(__dirname, assets/icon.png)); const contextMenu Menu.buildFromTemplate([ { label: Show, click: () mainWindow.show() }, { label: Quit, click: () app.quit() } ]); tray.setToolTip(t3code); tray.setContextMenu(contextMenu); // 深色模式同步 nativeTheme.on(updated, () { mainWindow.webContents.send(theme-updated, nativeTheme.shouldUseDarkColors); }); });4.4 CLI 子系统cli/cli.js完整实现#!/usr/bin/env node const { spawn } require(child_process); const { stdin, stdout, stderr } process; const { promisify } require(util); const readFile promisify(require(fs).readFile); // 参数解析极简版避免依赖 const args process.argv.slice(2); let input ; let model llama3:8b; let task refactor; let target typescript; for (let i 0; i args.length; i) { switch (args[i]) { case --model: model args[i]; break; case --task: task args[i]; break; case --target: target args[i]; break; } } // 读取 stdin stdin.setEncoding(utf8); stdin.on(data, chunk input chunk); stdin.on(end, async () { try { // 构建 prompt const prompt You are a senior developer. Refactor the following code to ${target}:\n\\\\n${input}\n\\\; // 调用 backend const backend await detectLocalBackend(); const result await callBackend(backend, prompt, model); // 输出结果ANSI 高亮 stdout.write(\x1b[1mRefactored ${target}:\x1b[0m\n); stdout.write(\x1b[36m${result}\x1b[0m\n); } catch (err) { stderr.write(Error: ${err.message}\n); process.exit(1); } }); async function detectLocalBackend() { // 同 main.js 中的 detectBackend复用逻辑 } async function callBackend(backend, prompt, model) { const url http://localhost:${backend.port}/api/chat; const body JSON.stringify({ model, messages: [{ role: user, content: prompt }], stream: false }); const res await fetch(url, { method: POST, headers: { Content-Type: application/json }, body }); if (!res.ok) throw new Error(Backend error: ${res.status}); const json await res.json(); return json.message.content; }4.5 打包发布Electron Builder 配置与签名实战build/win.ymlWindows NSISnsis: oneClick: false allowToChangeInstallationDirectory: true createDesktopShortcut: true createStartMenuShortcut: true shortcutName: t3code include: ./build/installer.nsh script: ./build/nsis-script.nsh artifactName: t3code-${version}-setup.${ext}build/installer.nsh关键内容!macro customHeader !insertmacro MUI_PAGE_LICENSE ${BUILD_RESOURCES_DIR}\license.txt !macroend !macro customInstall # 创建服务可选 nsExec::Exec $INSTDIR\resources\app\bin\ollama.exe serve !macroend签名实操步骤Windows获取 EV 证书.pfx 文件安装证书到Local Machine\Personal在electron-builder配置中添加win: { certificateFile: ./cert/t3code-ev.pfx, certificatePassword: your-password }构建时自动签名验证命令Get-AuthenticodeSignature dist\win-unpacked\t3code.exe签名实操步骤macOS申请 Apple Developer ID Application 证书在 Xcode 中创建 Provisioning Profilebuild/mac.yml中配置mac: { hardenedRuntime: true, gatekeeperAssess: true, entitlements: build/entitlements.plist, notarize: true, notarizeWait: true }entitlements.plist必须包含?xml version1.0 encodingUTF-8? !DOCTYPE plist PUBLIC -//Apple//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd plist version1.0 dict keycom.apple.security.cs.allow-jit/key true/ keycom.apple.security.cs.allow-unsigned-executable-memory/key true/ keycom.apple.security.network.client/key true/ /dict /plist5. 常见问题排查与独家避坑指南5.1 “model not found” 类错误的根因分析与解决网络热词中高频出现的lm studio cli 启动模型时提示“model not found”表面是模型路径问题实则是backend 协议不匹配。LM Studio 的/v1/chat/completions接口要求model字段必须是 LM Studio UI 中显示的 exact name如Phi-3-mini-4k-instruct.Q4_K_M.gguf而 t3code 默认发送model: phi3:mini这是 ollama 的命名规范。排查流程打开 LM Studio确认模型已加载且状态为Running在浏览器访问http://localhost:1234/v1/models复制返回 JSON 中id字段的值在 t3code 设置中将 backend 设为lm-studiomodel 设为上一步复制的id若仍失败检查 LM Studio 设置 →Advanced→Enable HTTP server是否勾选。独家技巧我们开发了一个t3code diagnose命令自动探测所有 backend 并输出兼容性报告t3code diagnose # 输出 # [✓] ollama: http://localhost:11434 - model: llama3:8b (OK) # [!] lm-studio: http://localhost:1234 - model: phi3:mini (NOT FOUND, use Phi-3-mini-4k-instruct.Q4_K_M.gguf) # [ ] text-gen-webui: http://localhost:8000 - connection refused5.2 Homebrew 安装失败的 5 种场景与修复方案场景现象根本原因解决方案Rosetta 未启用brew install t3code报错command not found: brewM1/M2 Mac 未启用 Rosetta 2Homebrew 安装脚本失败在终端

读完文章,也想定制专属网站?

尧图设计师 24 小时内与您沟通定制方案

免费获取报价 →
↑