在 512 MB 内存的设备上,把「思考」放到云端,把「动手」留在本地,是最站得住的做法。CardputerZero 已经为此准备了两条路:官方预装的 ZClaw,以及自己写一个精简的 Python 客户端。

先用官方的 ZClaw

官方操作说明把 ZClaw 列为内置应用:它是基于 ZeroClaw 的 AI 助手,支持配置多个 AI 服务。首次打开时按向导填写服务 URL、API Key 等参数;完成向导后,ZClaw 会自动下载所需程序。之后用 Enter 输入消息,F / X 滚动对话,TAB 打开设置。

如果更想在电脑上粘贴密钥,官方建议先在设备上用临时值走完向导,再通过 SSH 或 ADB 编辑下面这个文件(把 {username} 换成设备上的 Linux 用户名),并保留原有字段顺序和 Tab 分隔符:

/home/{username}/.zeroclaw/zclaw_providers.tsv

这些步骤以官方操作说明为准。

开源的 CardputerZero launcher 仓库对 ZClaw 的定位更具体:它是一个面向 320 × 170 屏幕的键盘优先 LVGL 聊天客户端,可引导配置 OpenAI、OpenRouter、Anthropic、Ollama、DeepSeek 以及自定义服务,并支持与 ZeroClaw webhook 配对,以及针对 agent 返回的工具请求做交互式批准。

ZeroClaw 本身是用 Rust 写的开源 agent 运行时:模型可以来自多家云端或本地服务,再通过 shell、HTTP、浏览器、硬件和 MCP 等工具行动。ZClaw 是设备上的对话界面;工具具体在哪台机器上执行,取决于你把 ZeroClaw 运行在本机还是另一台电脑,并以你实际完成的配置为准。不要在未阅读 ZeroClaw 的安全与权限说明之前,就授予不受限制的 shell 权限。

注意

ZClaw 的服务向导里出现 Ollama,并不等于这台 512 MB 的机器适合本机运行 Ollama 服务。把 Ollama 指向局域网里另一台内存充足的电脑,才符合这条「远端推理」路径。

自己写一个只执行白名单工具的客户端

若你想完全控制工具范围,可以在设备的 CLI 或 SSH 会话里运行一个小脚本。官方镜像已有 Python 3。下面的示例只使用 Python 标准库(urllib、json、subprocess),不需要 pip 安装额外包装,也不会在本地加载任何语言模型。

完整脚本与本文放在同一目录,可直接查看或下载:tiny_cloud_agent.py。它会:

  • 读取环境变量 OPENAI_API_KEY(必需),以及可选的 OPENAI_BASE_URL、OPENAI_MODEL;
  • 向 OpenAI 兼容的 Chat Completions 接口声明两个工具:host_info(读取 /proc/meminfo 等)和 run_allowed(只允许 uname、uptime、ip4 三条命令);
  • 最多循环六轮工具调用,然后打印适合小屏幕的短回答。

在设备上确认网络已连接后:

export OPENAI_API_KEY="your-key"
# Optional, for a compatible endpoint:
# export OPENAI_BASE_URL="https://example-compatible-api/v1"
# export OPENAI_MODEL="your-model-name"

python3 tiny_cloud_agent.py "现在还剩多少内存?"

命令白名单是有意收得很紧的:

ALLOWED_COMMANDS = {
    "uname": ["uname", "-a"],
    "uptime": ["uptime"],
    "ip4": ["ip", "-4", "addr", "show"],
}

脚本拒绝白名单以外的命令,也不会使用 shell=True 去拼接模型输出。在一台随身 Linux 电脑上,把任意命令交给模型执行,风险很高。若要增加工具(例如读取某个传感器,或打开已经拍好的照片),应当逐项加入白名单,并在 设备工具 里提到的约束下测试。

依赖非常明确:Python 3 标准库、可用的 2.4 GHz Wi-Fi 或 Host 模式下的以太网,以及一个支持 tool calling 的 OpenAI 兼容 API。密钥不要写入即将发布的仓库或世界可读文件。设备丢失时,应能立刻吊销密钥。

On a 512 MB device, the defensible design is to think in the cloud and act locally. CardputerZero already offers two ways to do that: the preinstalled ZClaw app, and a small Python client you control yourself.

Start with official ZClaw

The official usage guide lists ZClaw as a built-in app: an AI assistant based on ZeroClaw that can be configured for multiple AI services. On first launch, a wizard asks for a service URL, API key, and related parameters. After you finish the wizard, ZClaw downloads the software it needs. Then Enter composes a message, F / X scrolls the thread, and TAB opens settings.

If you would rather paste the key from a computer, official documentation suggests completing the wizard on the device with temporary values, then editing the following file over SSH or ADB (replace {username} with the Linux username on the device). Keep the original field order and tab separators:

/home/{username}/.zeroclaw/zclaw_providers.tsv

Follow the official usage guide for these steps.

The open-source CardputerZero launcher repository is more specific about what ZClaw is: a keyboard-first LVGL chat client for the 320 × 170 display, with guided setup for OpenAI, OpenRouter, Anthropic, Ollama, DeepSeek, and custom providers. It also supports ZeroClaw webhook pairing and interactive approval of tool requests returned by the agent.

ZeroClaw itself is an open-source Rust agent runtime. Models can come from many cloud or local providers, and the runtime can act through tools such as a shell, HTTP, a browser, hardware, and MCP servers. ZClaw is the on-device conversation UI. Where the tools actually run depends on whether you place the ZeroClaw runtime on the CardputerZero or on another computer, and on the configuration you actually complete. Do not grant an unrestricted shell before reading ZeroClaw’s security and permission guidance.

Note

Ollama appearing in the ZClaw setup wizard does not mean this 512 MB machine is a good host for an Ollama server. Pointing Ollama at another computer on the LAN with enough RAM is what stays on the “remote inference” path.

Or write a client that only runs allowlisted tools

If you want strict control over the tool surface, run a small script from the on-device CLI or an SSH session. Official images already include Python 3. The example below uses only the Python standard library (urllib, json, subprocess). It needs no extra pip packages and does not load a language model locally.

The full script lives next to this article: tiny_cloud_agent.py. It:

  • reads OPENAI_API_KEY (required) and optional OPENAI_BASE_URL and OPENAI_MODEL environment variables;
  • declares two tools to an OpenAI-compatible Chat Completions API: host_info (reads /proc/meminfo and related facts) and run_allowed (only uname, uptime, and ip4);
  • allows at most six tool rounds, then prints a short reply.

After the device is on a network:

export OPENAI_API_KEY="your-key"
# Optional, for a compatible endpoint:
# export OPENAI_BASE_URL="https://example-compatible-api/v1"
# export OPENAI_MODEL="your-model-name"

python3 tiny_cloud_agent.py "How much memory is still free?"

The command allowlist is intentionally narrow:

ALLOWED_COMMANDS = {
    "uname": ["uname", "-a"],
    "uptime": ["uptime"],
    "ip4": ["ip", "-4", "addr", "show"],
}

Anything outside that list is rejected, and the script never uses shell=True to interpolate model output. On a pocket Linux computer, handing the model an arbitrary shell is a serious risk. If you add tools—reading a sensor, or opening a photo that was already captured—add them to the allowlist one at a time and test them under the constraints in device tools.

The dependencies are explicit: the Python 3 standard library, working 2.4 GHz Wi-Fi or Ethernet in Host mode, and an OpenAI-compatible API that supports tool calling. Do not put API keys in a public repository or a world-readable file. If the device is lost, you should be able to revoke the key immediately.