@agentium/edge

中文文档
4.11.0发布于 2026/10/24MITTypeScriptESM + CJS近 30 天下载 1967

Edge deployment for Agentium — IoT toolkits (GPIO, sensors, camera, BLE), edge runtime, and Ollama helpers for Raspberry Pi

原始使用文档
文档目录9 节
  1. Install
  2. Quick Start — Ollama-backed local agent on a Pi
  3. IoT Toolkits
  4. Edge Runtime
  5. Cloud Sync
  6. Documentation
  7. Community
  8. License
  9. Sync and camera behavior

@agentium/edge

Edge deployment for Agentium — IoT toolkits (GPIO, sensors, camera, BLE, servo, system) plus an edge runtime with resource monitoring, presets, and Ollama helpers. Designed for Raspberry Pi but works on any Linux SBC.

Install

npm install @agentium/edge

Hardware toolkits load their native bindings on demand. Install only what you use, e.g.:

npm install onoff           # GPIO
npm install i2c-bus         # sensors
npm install @abandonware/noble  # BLE

Quick Start — Ollama-backed local agent on a Pi

import { Agent } from "@agentium/core";
import { EdgeRuntime, edgePreset, ollama } from "@agentium/edge";

const runtime = new EdgeRuntime(edgePreset("pi-5-balanced"));
await runtime.start();

const agent = new Agent({
  name: "edge-bot",
  model: ollama(runtime.recommendedModel),
  instructions: "You are an edge AI assistant running on-device.",
});

console.log(await agent.run("hello"));

IoT Toolkits

Each toolkit exposes typed tools (with Zod schemas) the agent can call:

ToolkitExample tools
GpioToolkitgpio.write, gpio.read, gpio.toggle
SensorToolkitsensor.read_temperature, sensor.read_humidity (I²C / 1-Wire)
CameraToolkitcamera.snapshot, camera.start_stream
BleToolkitble.scan, ble.connect, ble.read_characteristic
ServoToolkitservo.move_to, servo.center
SystemToolkitsystem.cpu_temp, system.uptime, system.shutdown
import { Agent } from "@agentium/core";
import { GpioToolkit, SensorToolkit } from "@agentium/edge";

const agent = new Agent({
  name: "garden-bot",
  model: ollama("llama3.2:3b"),
  toolkits: [
    new GpioToolkit({ pumpPin: 17 }),
    new SensorToolkit({ moistureBus: 1 }),
  ],
});

await agent.run("Water the plants if soil moisture is below 30%.");

Edge Runtime

EdgeRuntime continuously monitors CPU, RAM, temperature, and storage so you can react to resource pressure (downsize the model, defer non-critical tools, sync to cloud, etc.).

const runtime = new EdgeRuntime(edgePreset("pi-zero-2-low-power"));
runtime.on("threshold:cpu", (s) => console.warn("CPU pressure", s));
await runtime.start();

Cloud Sync

EdgeCloudSync ships local agent runs / sensor logs to a central endpoint with offline queueing — useful for fleets of Pis with intermittent connectivity.

Documentation

Full docs at docs.agentium.in

Community

Join the conversation on Discord.

License

MIT

Sync and camera behavior

Concurrent flush calls share the active delivery batch. Events queued during that request remain persisted for the next batch; only acknowledged IDs are removed. Failed deliveries retain their batch for retry, so receivers must handle duplicate delivery. Camera capture returns the complete base64 image before deleting its temporary file; applications still choose how to present the image to a multimodal model.

版本与发布记录

@agentium/edge 共发布 40 个版本,首次发布于 2026/05/22;过去 12 个月发布了 40 个版本。

版本发布日期距今
4.11.0latest2026/10/2414 天前
4.10.02026/10/2414 天前
4.9.02026/10/1325 天前
4.8.32026/10/1226 天前
4.8.22026/10/1028 天前
4.8.12026/10/1028 天前

关于 @agentium/edge 的常见问题

@agentium/edge 是什么?

Edge deployment for Agentium — IoT toolkits (GPIO, sensors, camera, BLE), edge runtime, and Ollama helpers for Raspberry Pi

如何安装 @agentium/edge?

在项目目录运行 npm install @agentium/edge,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@agentium/core(^4.11.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@agentium/edge 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@agentium/edge 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@agentium/edge 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js ^22.18.0 || ^24.11.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@agentium/edge 可以商用吗?

@agentium/edge 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@agentium/edge 的下载量有多少?

根据 npm 官方下载统计,@agentium/edge 在 2026/10/05 – 2026/11/03 这 30 天内被下载 1,967 次,日均约 66 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@agentium/edge 还在维护吗?

最新版本 4.11.0 发布于 2026/10/24(14 天前);至今共发布 40 个版本,其中过去 12 个月发布了 40 个;首次发布于 2026/05/22。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。