ashhart / TensorFold
本文为原文前 6,000 字符的节选翻译,完整内容请查看原文。
TensorFold serves language models from a Zig binary on Apple Silicon and NVIDIA GPUs. The engine reads checkpoints, tokenizes requests and runs Metal or CUDA kernels directly. Serving needs no Python or MLX installation. Building with a coding agent? Have it load the contributor skill before it writes any code.
TensorFold 通过 Zig 二进制文件在 Apple Silicon 和 NVIDIA GPU 上提供语言模型服务。该引擎直接读取检查点、对请求进行分词并运行 Metal 或 CUDA 内核。服务过程无需安装 Python 或 MLX。正在使用编码智能体进行构建?请让它在编写任何代码之前加载贡献者技能。
Contributing with agents Please use Agent Traffic Control before editing TensorFold so contributors and agents can avoid duplicate work and conflicting changes. Check the live agent radar before choosing an issue and follow CONTRIBUTING.md and the ATC contributor instructions. Install or upgrade ATC to 0.9.4 or later, then run from an updated TensorFold clone: npm install -g github:ashhart/ATC atc check ISSUE —json atc claim ISSUE —json Replace ISSUE with the issue number and claim only after a complete check says the work is free.
使用智能体进行贡献时,请在编辑 TensorFold 之前使用智能体流量控制(Agent Traffic Control),以便贡献者和智能体能够避免重复工作和冲突更改。在选择议题前请查看实时智能体雷达,并遵循 CONTRIBUTING.md 和 ATC 贡献者指南。安装或升级 ATC 至 0.9.4 或更高版本,然后从更新后的 TensorFold 克隆版本中运行:npm install -g github:ashhart/ATC,atc check ISSUE —json,atc claim ISSUE —json。将 ISSUE 替换为议题编号,且仅在完整检查显示该工作空闲后才进行认领。
TensorFold enables automatic public check-ins: a successful new claim starts an anonymous session on the radar and returns its session number. Keep that number instead of starting a duplicate session. For work already yours, start a session with atc start ISSUE —json. Add —github-name to claim or start only if you want your verified GitHub name shown; —local keeps a new session on your machine.
TensorFold 支持自动公开签到:成功的新认领会在雷达上启动一个匿名会话并返回会话编号。请保留该编号,不要启动重复会话。对于您已有的工作,请使用 atc start ISSUE —json 启动会话。仅当您希望显示已验证的 GitHub 名称时,才在认领或启动时添加 —github-name;—local 参数会将新会话保留在您的本地机器上。
The board shows the issue, activity state and last check-in; GitHub still associates the verification comment with its author. Check that publication is public; unavailable means the public update failed even if the local claim or session succeeded. Pulse only while the agent is working, before its five-minute check-in expires: atc pulse ISSUE SESSION working —json atc who path/to/file —json atc overlap —json atc land ISSUE SESSION —json atc release ISSUE —json Use reviewing or blocked when appropriate, land the session when it stops, and resolve overlaps before opening a pull request.
看板会显示议题、活动状态和最后签到时间;GitHub 仍会将验证评论与其作者关联。请检查发布是否公开;如果显示不可用,则意味着即使本地认领或会话成功,公开更新也失败了。仅在智能体工作期间、在其五分钟签到过期前发送脉冲:atc pulse ISSUE SESSION working —json,atc who path/to/file —json,atc overlap —json,atc land ISSUE SESSION —json,atc release ISSUE —json。在适当的时候使用 reviewing 或 blocked 状态,在会话停止时进行 land 操作,并在打开拉取请求前解决重叠问题。
Before opening a pull request, have the agent run the pull request skill; agents that support skills can install it as tensorfold-pull-request. Quick start Start with Qwen3.5-2B, the small 4-bit checkpoint checked on Metal and a GB10. The commands below download its pinned revision, then serve it as local-model. Model weights have their own licenses.
在打开拉取请求之前,请让智能体运行拉取请求技能;支持技能的智能体可以将其安装为 tensorfold-pull-request。快速入门:从 Qwen3.5-2B 开始,这是在 Metal 和 GB10 上经过验证的小型 4-bit 检查点。以下命令下载其固定版本,然后将其作为 local-model 提供服务。模型权重拥有各自的许可证。
Reviewing or benchmarking TensorFold? Evaluating TensorFold covers pinning, signature checks, a container and the tests that need no GPU. Mac with Apple Silicon Install with Homebrew, then start the server: brew install ashhart/tensorfold/tensorfold tensorfold pull mlx-community/Qwen3.5-2B-MLX-4bit@93760be4f1f69842a46bc13dbdc0f19e291392a3 tensorfold serve mlx-community/Qwen3.5-2B-MLX-4bit —name local-model —context 8192 —no-thinking
正在审查或基准测试 TensorFold?评估 TensorFold 涵盖了固定版本、签名检查、容器以及无需 GPU 的测试。配备 Apple Silicon 的 Mac:使用 Homebrew 安装,然后启动服务器:brew install ashhart/tensorfold/tensorfold,tensorfold pull mlx-community/Qwen3.5-2B-MLX-4bit@93760be4f1f69842a46bc13dbdc0f19e291392a3,tensorfold serve mlx-community/Qwen3.5-2B-MLX-4bit —name local-model —context 8192 —no-thinking。
Linux with an NVIDIA GPU Use the release archive for your CPU: linux-aarch64 on a GB10, linux-x86_64 on an x86_64 host. It needs glibc 2.28 or newer and NVIDIA driver R580 or newer (CUDA 13.0), providing libcuda.so.1. Keep the archive’s directories together. Its kernels are built with CUDA 13, so TensorFold refuses an older driver at startup; nvidia-smi shows the installed one. See the CUDA runbook for runtime libraries and supported GPUs.
配备 NVIDIA GPU 的 Linux:请使用适用于您 CPU 的发布归档文件:GB10 上使用 linux-aarch64,x86_64 主机上使用 linux-x86_64。它需要 glibc 2.28 或更高版本以及提供 libcuda.so.1 的 NVIDIA 驱动程序 R580 或更高版本(CUDA 13.0)。请保持归档文件的目录结构完整。其内核是使用 CUDA 13 构建的,因此 TensorFold 会在启动时拒绝较旧的驱动程序;nvidia-smi 可显示已安装的驱动程序版本。有关运行时库和支持的 GPU,请参阅 CUDA 手册。
Send a request Leave the server running. In another terminal, on either platform: curl -fsS http://127.0.0.1:8080/v1/chat/completions \ -H ‘Content-Type: application/json’ \ -d ’{“model”:“local-model”,“messages”:[{“role”:“user”,“content”:“Say hello in one sentence.”}],“max_tokens”:128,“temperature”:0}’ The API also serves completions, Responses and Anthropic Messages. /v1/models lists the served name.
发送请求:保持服务器运行。在另一个终端中,无论在哪个平台上:curl -fsS http://127.0.0.1:8080/v1/chat/completions \ -H ‘Content-Type: application/json’ \ -d ’{“model”:“local-model”,“messages”:[{“role”:“user”,“content”:“Say hello in one sentence.”}],“max_tokens”:128,“temperature”:0}‘。该 API 还提供补全、响应和 Anthropic 消息服务。/v1/models 列出了所提供的模型名称。
On Windows with an NVIDIA GPU, follow the native Windows build guide. Use tensorfold —help, tensorfold capabilities —json and tensorfold serve REPO —help to inspect your binary. You can also serve a complete local checkpoint directory or an existing Hugging Face cache. tensorfold web [ARGS…] opens TensorFold Web, a small local web app for picking, running and chatting with models.
在配备 NVIDIA GPU 的 Windows 上,请遵循原生 Windows 构建指南。使用 tensorfold —help、tensorfold capabilities —json 和 tensorfold serve REPO —help 来检查您的二进制文件。您还可以提供完整的本地检查点目录或现有的 Hugging Face 缓存。tensorfold web [ARGS…] 会打开 TensorFold Web,这是一个用于选择、运行模型并与之聊天的轻量级本地 Web 应用。
If it needs installing, an interactive release binary offers to install its matching version with uv after you say yes. See the web launcher for manual installation and unattended use. —parallel N caps active requests at N; extra requests wait for a free slot. Omitting the flag uses —parallel auto, which asks for up to eight streams as memory and the engine allow. An explicit number is refused if the engine cannot fit that many streams.
如果需要安装,交互式发布二进制文件会在您确认后提供使用 uv 安装匹配版本的功能。请参阅 Web 启动器以了解手动安装和无人值守使用方法。—parallel N 将活动请求限制为 N 个;额外的请求将等待空闲槽位。省略该标志将使用 —parallel auto,它会根据内存和引擎允许的情况请求最多八个流。如果引擎无法容纳指定数量的流,则会拒绝该明确数值。
Read the engine’s startup capacity line, such as 8 streams at once on CUDA, for the count it accepted. With API authentication off, /health reports live.connections as active plus waiting requests and live.waiting as the queued count. For example, 8 connections with 4 waiting means 4 active requests. Completing or cancelling an active request frees its slot; cancelling a waiting request removes it from the queue.
请阅读引擎启动时的容量行(例如“8 streams at once on CUDA”)以获取其接受的数量。在关闭 API 身份验证的情况下,/health 会报告 live.connections(活动请求加上等待请求)和 live.waiting(排队数量)。例如,8 个连接中有 4 个在等待意味着有 4 个活动请求。完成或取消活动请求会释放其槽位;取消等待请求会将其从队列中移除。
Mac app The TensorFold desktop workspace bundles the local engine, model downloads, hardware recommendations, live generation metrics, coding workers and document editing. Download the Apple-silicon beta 9 DMG, or build from app/. The desktop app launches the bundled tensorfold-native executable directly. Mobile clients in app/mobile/ remain preview software. TensorFold Starlight (enterprise) TensorFold Starlight gives an organisation one governed OpenAI- and Anthropic-compat
Mac 应用:TensorFold 桌面工作区集成了本地引擎、模型下载、硬件建议、实时生成指标、编码工作者和文档编辑功能。下载 Apple-silicon beta 9 DMG,或从 app/ 构建。桌面应用直接启动捆绑的 tensorfold-native 可执行文件。app/mobile/ 中的移动客户端仍处于预览软件阶段。TensorFold Starlight(企业版):TensorFold Starlight 为组织提供了一个受管的、兼容 OpenAI 和 Anthropic 的环境。