Fully local · Zero API · No Ollama

DevonAI

Your personal agent that runs entirely on your machine.
Single binary. Fully offline. Zero cloud dependency.

DevonAI — Local Agent
❯ devonai
Loading model dev0.1-q4_k_m.gguf ...
Model ready · context 8192 · local quantized model
──────────────────────────────
you › Analyze the project structure and suggest improvements
Thinking...
→ tool: fileTool.list + terminalTool
Devon › Scanned 24 files. Suggest refactoring engine init in src/core...

Built for real local work

Not another cloud chatbot. A complete agent system that runs on your own machine.

Interface

Terminal-native UI

TypeScript + React + Ink. Status bar, streaming chat, thinking indicators, and a fixed input box — all driven by the event bus.

Inference

In-process local models

Loads GGUF models directly inside the Node.js process with node-llama-cpp. No Ollama daemon. No external services.

Agent

ReAct loop

Think → tool call → local execution → result back to the model. Multi-turn until the task is done or a limit is hit.

Safety

Sandboxed tools

Terminal commands are filtered for high-risk patterns. File tools are restricted to the project root with path traversal protection.

Setup

Automatic model download

On first launch the agent checks for a local model and downloads a lightweight quantized checkpoint from Hugging Face if needed.

Runtime

Event-driven core

A global EventBus connects the model engine and the UI. Tokens, tool calls, and results update the interface in real time.

Three core modules

From interface to engine to tools — every layer is designed for local-first operation.

Module 1 · Terminal UI

A modern terminal interface with a status header, streaming chat history, thinking indicators, and a fixed input box. Everything is driven by the event bus so the UI stays in sync while the agent thinks or runs tools.

View structure
// src/ui/App.tsx
import { Header, ChatStream, InputBox } from './components';
import { eventBus } from '../core/eventBus';

export function App() {
  const [messages, setMessages] = useState([]);
  // Listen to core events and update UI
  useEffect(() => { ... }, []);
  return (
    <Box flexDirection="column">...
  );
}

Module 2 · Local model engine

node-llama-cpp loads GGUF models in-process. On first run the agent checks for a local model and downloads a lightweight quantized checkpoint if needed. streamPrompt provides efficient token streaming with sensible defaults.

How download works
// src/core/engine.ts
import { getLlama, LlamaChatSession } from 'node-llama-cpp';

export async function streamPrompt(prompt: string) {
  const session = new LlamaChatSession({ ... });
  for await (const chunk of session.prompt(prompt)) {
    eventBus.emit('token', chunk);
  }
}

Module 3 · Agent loop & tools

A ReAct loop coordinates thinking and tool use. A robust JSON parser recovers tool calls from imperfect model output. terminalTool blocks dangerous commands; fileTool stays inside the project root.

Tool design
// High-risk command filter
const BLOCKED = [
  /rm\s+-rf\s+[\/~]/,
  /mkfs/, /dd\s+if=/,
  /chmod\s+-R\s+777\s+\/
];

if (BLOCKED.some(r => r.test(cmd))) {
  throw new Error('Blocked dangerous command');
}

Why DevonAI

How it differs from common setups.

Capability DevonAI Ollama + extras Cloud API
Fully offline Yes Yes No
No extra daemon Yes Needs Ollama Needs network
Single-binary feel Yes Multiple parts Account + key
Data never leaves the machine Yes Yes No
Built-in tool sandbox Yes DIY Limited
Terminal-native UI Yes — —
Automatic model management Yes Yes —

Start building your local agent

Full source, download scripts, inference engine, agent loop,
and terminal UI components — ready to run.