ASAgentStead Docs
Runtimes

OpenFang

The OpenFang runtime — Rust-based agent with REST API, Ollama fallback, and ffmpeg on agentstead.dev.

OpenFang is a Rust-based agent runtime with a REST API surface. It's the right choice when you want an API-oriented interface, a lightweight default configuration without requiring an upstream provider key, or media processing capabilities via ffmpeg.

Port: 4200 | Token type: API Key | Best for: API-oriented workflows, media processing, Rust tooling

What starts on boot

  1. Homebrew seeding — same as all runtimes, seeds to /data/homebrew on first boot.
  2. OpenFang init — runs once on first boot: openfang init --quick initialises ~/.openfang/.
  3. Chrome with CDP — starts on port 9222 for browser automation.
  4. OpenFang daemon — starts on port 4200, bound to 0.0.0.0. Auto-restarts on crash.

No provider key required

OpenFang defaults to Ollama with llama3.2:3b as its provider — so the agent starts and the API works without any upstream API key. You can add provider keys to use hosted models instead.

The Ollama default gives you a working agent out of the box, but responses will be limited by the llama3.2:3b model. Add a provider key for production-quality results.

Configuration

OpenFang config lives in ~/.openfang/:

FilePurpose
~/.openfang/config.tomlProvider and model selection
~/.openfang/.envAPI keys (auto-populated from Secrets)

Default config.toml:

~/.openfang/config.toml
[default_model]
provider = "ollama"
model = "llama3.2:3b"

API key injection

Add any of these to Secrets in the dashboard — they're written to ~/.openfang/.env on every boot:

Secret nameProvider
OPENROUTER_API_KEYOpenRouter
ANTHROPIC_API_KEYAnthropic (Claude)
OPENAI_API_KEYOpenAI
GROQ_API_KEYGroq
GEMINI_API_KEYGoogle Gemini
MISTRAL_API_KEYMistral

Getting started

Deploy and wait for ONLINE

OpenFang is ready as soon as the agent shows ONLINE — no API key needed to start.

Find your API key

Open the agent → Access & Credentials → copy the API Key (this is your OpenFang authentication token). Your public URL is also here.

Make an API call

Test the API
curl https://your-agent.eu2.agentstead.dev/api/chat \
  -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{"message": "Hello"}'

Add a provider key (optional)

To use a hosted model instead of the Ollama fallback, add a key to Secrets, restart the agent, and update config.toml in the desktop terminal:

~/.openfang/config.toml
[default_model]
provider = "anthropic"
model = "claude-3-5-sonnet-20241022"

ffmpeg

OpenFang is the only runtime that includes ffmpeg pre-installed. This makes it well-suited for:

  • Video transcoding and processing pipelines
  • Audio extraction and manipulation
  • Streaming media workflows
  • Any agent that handles video or audio files
ffmpeg -version
# ffmpeg version 6.x...

# Example: extract audio from video
ffmpeg -i input.mp4 -vn -acodec copy output.aac

AI coding tools

OpenFang includes the same AI coding tools as all other runtimes. See Pre-installed Tools:

Claude Code

claude — set ANTHROPIC_API_KEY in Secrets.

Codex

codex — set OPENAI_API_KEY in Secrets.

OpenCode

opencode — multi-provider TUI.

VS Code + Kilo Code

Pre-installed with Kilo Code extension.