@ agentium/ edge (帮助)
Agentium的边缘部署——IOT工具包(GPIO,传感器,相机,BLE,Servo,系统)加上有资源监测,预设,和Ollama帮助器的边缘运行时间. 为Raspberry Pi所设计,但在任何Linux SBC上工作.
安装
npm install @agentium/edge
硬件工具包按要求装入其原生装订. 只安装您使用的东西, 例如 :
npm install onoff # GPIO
npm install i2c-bus # sensors
npm install @abandonware/noble # BLE
快速启动 — Ollama 支持的本地代理
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"));
信息技术工具包
每个工具包都暴露了打入的工具(带有Zod schemas),代理可以称为:
| 工具包 | 示例工具 |
|---|---|
GpioToolkit | gpio.write, (中文(简体) ), gpio.read, (中文(简体) ), gpio.toggle |
SensorToolkit | sensor.read_temperature, (中文(简体) ), sensor.read_humidity (I2C/一线) |
CameraToolkit | camera.snapshot, (中文(简体) ), camera.start_stream |
BleToolkit | ble.scan, (中文(简体) ), ble.connect, (中文(简体) ), ble.read_characteristic |
ServoToolkit | servo.move_to, (中文(简体) ), servo.center |
SystemToolkit | system.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%.");
边缘运行时间
EdgeRuntime 持续监控CPU,RAM,温度和存储,以便能对资源压力做出反应(缩小模型大小,推迟非关键工具,同步到云等).
const runtime = new EdgeRuntime(edgePreset("pi-zero-2-low-power"));
runtime.on("threshold:cpu", (s) => console.warn("CPU pressure", s));
await runtime.start();
云同步
EdgeCloudSync 船舶本地代理运行/传感器日志到一个中央端点,并进行离线排队——对有间断连接的皮斯舰队有用.
文档
完整文件时间 参考文献. agentium.in
社区
加入对话 解析器。 。 。 .
许可证
麻省理工学院
同步和相机行为
同时期的冲锋呼叫共享活动交付批次. 下一批请求中排队的事件仍然存在;只有确认的身份证被取出。 出货失败保留了批次进行再试,因此接收者必须处理重复出货. 相机抓取在删除其临时文件之前返回完整的碱基64图像;应用程序仍然选择如何将图像呈现给多模式模型.