Skip to main content
@agentium/edge connects core Agents to device tools and provides resource monitoring, device presets, Ollama helpers, and a cloud-sync client. Start with a measured system reading, then add only the hardware and model capabilities your device needs. Your application owns the work loop and its response to unhealthy resources. The edge runtime reports degradation and watchdog timeouts; it does not automatically throttle, restart an Agent, or remove tools.

Why edge?

  • Local inference: use Ollama when requests and model processing should stay on the device.
  • Device tools: read system information or connect GPIO, I2C, cameras, BLE, and servos.
  • Observable operation: report resource usage and host-controlled health decisions.
  • Optional synchronization: queue bounded event batches and fetch configuration from your own cloud endpoints.

Quick start

This first program reads system resources and prints the available system-tool names. It does not call a model or write to hardware. Linux-specific readings may be unavailable on other platforms.
Save as inspect.ts:
Expect a measured memory percentage, a temperature or null, and system_info, system_process_list, and system_network_info. No monitoring timer is started. The monitor uses OS readings and probes nvidia-smi when available; a missing GPU does not prevent system inspection.

Choose a toolkit

Read-only system inspection is a useful first step before connecting actuators. Choose allowed pins, device access, tool approvals, and application limits for the specific hardware operation.

Connect a local model

Install and start Ollama separately, then download the model you intend to use. The package’s Ollama helpers can check availability or request a model download; they do not bundle Ollama or model weights. Preset recommendations are starting points, so measure latency and memory on your target workload. Install the core adapter’s optional dependency:
With Ollama already serving a downloaded model, save this as assistant.ts:
The answer should reflect the tool’s measurements; exact wording depends on the model. Use a model with tool-call support and inspect run events if it answers without measuring. This calls the local Ollama service. It does not install, start, or stop that service.

Supported devices

These are the built-in preset recommendations, not validated capacity guarantees: A preset does not configure every Agent or enforce process limits by itself. The example explicitly applies maxTokens; implement other limits in the host and model configuration where supported.

Package structure

Hardware dependencies

Install native npm dependencies only for the selected toolkit:
These are alternatives for GPIO/servo, I2C, and BLE respectively; the first system-inspection example needs none of them. CameraToolkit has no native npm dependency but still requires the external camera commands and working hardware. Review each toolkit’s OS requirements before deployment.

Extend the application

After one measured task works, add the runtime and demonstrate how your host stops admitting work or asks its process supervisor to restart. Add cloud sync only when the receiving endpoints and configuration-application policy exist. Use evaluation for representative answers and Ship for process supervision, ownership, and release checks.