Skip to content

feat: add ~agent@1.0, ~inference@1.0 and ~sev_gpu@1.0 devices#834

Open
jax-cn wants to merge 1 commit into
permaweb:edgefrom
apuslabs:pr/dev-agent
Open

feat: add ~agent@1.0, ~inference@1.0 and ~sev_gpu@1.0 devices#834
jax-cn wants to merge 1 commit into
permaweb:edgefrom
apuslabs:pr/dev-agent

Conversation

@jax-cn
Copy link
Copy Markdown

@jax-cn jax-cn commented Apr 10, 2026

Summary

This PR adds three new HyperBEAM devices along with supporting infrastructure.


~inference@1.0 (src/dev_inference.erl)

An OpenAI-compatible inference gateway that routes completion requests to a local or remote LLM backend via relay@1.0.

Key opts read at runtime:

Opt Default Description
agent-api-peer http://localhost:8080 Backend URL
agent-api-path caller-supplied API path (e.g. /v1/chat/completions)
agent-api-key Optional Bearer token

Works unchanged with local llama.cpp, OpenRouter, OpenAI, or any OpenAI-compatible endpoint.


~agent@1.0 (src/dev_agent.erl)

A ReAct-loop agent device. Iteratively:

  1. Calls LLM through inference@1.0/completions
  2. Parses tool_calls from the response
  3. Dispatches to built-in tools
  4. Feeds results back as tool role messages
  5. Repeats until the model emits a final answer

Built-in tools: http_request, lookup_data, search_messages, get_arweave_tx, bundle_item

All tools, the LLM call, and system prompt are overridable via Run key parameters.

Architecture

agent@1.0
    └─► inference@1.0 ──► relay@1.0 ──► local llama.cpp
                                    └──► remote provider (OpenRouter / OpenAI)

~sev_gpu@1.0 (src/dev_sev_gpu.erl + native/dev_sev_gpu_nif/)

SEV GPU device with NIF support for GPU-backed confidential compute.


Supporting changes

  • src/hb_opts.erl — register all three devices; add /v1/.*localhost:8080 route; inference_opts defaults
  • src/hb_http.erl / src/hb_http_server.erl — HTTP layer improvements
  • src/dev_meta.erl, src/dev_codec_http_auth.erl, src/hb_app.erl — supporting updates
  • rebar.config / Makefile — build support for SEV GPU NIF
  • docs/devices/agent-at-1-0.md — full device reference
  • docs/dev_agent-testing.md — testing / debugging guide
  • scripts/agent-test.lua, scripts/e2e-test.sh — test scripts
  • mkdocs.yml — add ~agent@1.0 to Devices nav
  • .gitignore — ignore .agents/, dev_sev_gpu logs

## ~inference@1.0  (src/dev_inference.erl)
OpenAI-compatible inference gateway routing completion requests to a
local or remote LLM backend via relay@1.0.  Backend peer, path, and
API key are read from node opts at runtime (agent-api-peer,
agent-api-path, agent-api-key).

## ~agent@1.0  (src/dev_agent.erl)
ReAct-loop agent device. Calls LLM through inference@1.0, parses
tool_calls, executes built-in tools, feeds results back, repeats
until the model emits a final answer.

Built-in tools: http_request, lookup_data, search_messages,
get_arweave_tx, bundle_item.

## ~sev_gpu@1.0  (src/dev_sev_gpu.erl + native/dev_sev_gpu_nif/)
SEV GPU device with NIF support for GPU-backed confidential compute.

Supporting changes:
- src/hb_opts.erl: register all three devices; add /v1/.* route
- src/hb_http.erl, src/hb_http_server.erl: HTTP layer improvements
- src/dev_meta.erl, src/dev_codec_http_auth.erl: supporting updates
- src/hb_app.erl: app startup updates
- rebar.config, Makefile: build support for NIF
- docs/devices/agent-at-1-0.md: device reference
- docs/dev_agent-testing.md: testing guide
- scripts/agent-test.lua, scripts/e2e-test.sh: test scripts
- mkdocs.yml: nav entry for ~agent@1.0
- .gitignore: ignore .agents/, dev_sev_gpu logs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant