Overview /docs/readme

README

Yoke logo

An agentic CLI coding harness for DeepSeek models ( deepseek-chat V3, deepseek-coder V2.5, and deepseek-reasoner R1), built in Elixir & Erlang/OTP . OpenRouter and local models are also supported.

Derived from José Valim's architectural framework for process-isolated AI agents, DeepSeek V3/R1 model architecture , Google Antigravity , and Warp Terminal TUI patterns .


Table of Contents


Architectural Foundation: José Valim's Vision & DeepSeek Model Integration

Yoke (Yoke) bridges modern LLM reasoning capabilities with Erlang/OTP's battle-tested fault tolerance and process concurrency model.

José Valim's Actor-Driven Harness Architecture

In traditional AI harnesses (typically single-threaded Node.js or Python runtimes), a tool execution error or unhandled exception can crash the entire interactive session, wiping out conversation context and active state. Yoke implements José Valim's vision for agentic harnesses on the BEAM virtual machine:

  • Decoupled Brain & Hands Architecture : The agent's cognitive state ("Brain") runs as an isolated GenServer process ( Yoke.Brain.Session ). Tool execution ("Hands") is cleanly separated ( Yoke.Hands.Executor ), allowing commands to execute locally, on remote Erlang nodes, or inside isolated Docker containers.
  • Fault-Tolerant Supervision : If a tool execution or sub-task process fails, the OTP supervision tree isolates the failure without impacting the user's interactive REPL session.
  • Spatiotemporal Checkpoints & Instant Rollback : State snapshots record conversation history, model configurations, and context state before each tool execution turn, providing temporal undo capabilities ( /undo ) and state branching.
  • Live Hot-Code Tool Reloading : Tools and plugins can be compiled, hot-swapped, or reloaded live ( /plugins reload ) without losing conversation memory or resetting GenServer process state.
  • Lightweight Parallel Subagents : Sub-tasks can be delegated to child session processes ( SessionSupervisor.start_session ), running parallel agentic loops concurrently across BEAM worker threads.
  • Concurrent OTP Task Engine : Batches of tool calls ( Yoke.TaskEngine.Orchestrator ) run concurrently under a Task.Supervisor , with per-file write locks and a real-time "N running" badge on the status bar ruler.
  • Distributed Erlang Node Clustering : Hands execution can target the local host, a remote Erlang node ( /mode remote ), or a Docker container ( /mode docker ), decoupling where the Brain thinks from where the Hands act.

DeepSeek Model Selection & Best Practices

Yoke supports the full suite of official DeepSeek models, local open-weights models, and third-party API aggregators. Switch models anytime via /model or --model :

Model ID / Alias in Yoke Best Used For Strengths & Characteristics




DeepSeek-V3 deepseek-chat
/model chat
Agentic workflows & multi-tool tasks (Default) 671B MoE model. Offers high general reasoning and highest tool-calling precision across multi-turn agent loops.
DeepSeek-Coder-V2.5 deepseek-coder
/model coder
Direct code generation, syntax completion & refactoring Trained specifically on 338+ programming languages . Produces idiomatic Elixir/C++/Rust code with high precision on syntax and language conventions.
DeepSeek-R1 deepseek-reasoner
/model reasoner
Complex debugging & architectural design Reinforcement Learning (RL) reasoning model. Yoke captures and streams [DeepSeek-R1 Reasoning] Chain-of-Thought output live before tool execution.

OpenRouter, OpenCode Go & Local Model Integration (SGLang, Ollama, LM Studio, vLLM)

While yoke defaults to the official remote DeepSeek API ( https://api.deepseek.com/chat/completions with deepseek-chat ), it provides native support for OpenRouter , OpenCode Go (Console Go) , and local inference engines ( SGLang , Ollama , LM Studio , vLLM ).

A. OpenRouter Configuration Connect yoke to OpenRouter endpoints (such as meta-llama/llama-3.3-70b-instruct:free , qwen/qwen-2.5-coder-32b-instruct:free , or deepseek/deepseek-r1:free ):

Environment Variables :

export OPENROUTER_API_KEY="sk-or-v1-..."
export DEEPSEEK_ENDPOINT="https://openrouter.ai/api/v1/chat/completions"
export DEEPSEEK_MODEL="meta-llama/llama-3.3-70b-instruct:free"

yoke

CLI Flags :

yoke -e openrouter -m meta-llama/llama-3.3-70b-instruct:free

Live REPL Commands :

/endpoint openrouter
/model openrouter-free

B. OpenCode Go (Console Go) Configuration

Connect yoke to OpenCode Go / Zen endpoints:

Automatic x-opencode-session Routing Header : OpenCode Go requires the x-opencode-session header on every request for backend routing and prompt caching optimization. Yoke automatically attaches this header using the session's unique identifier.

Environment Variables :

export OPENCODE_API_KEY="your-opencode-key"
# Optional custom base URL (defaults to OpenCode Go endpoint when using shortcut):
export OPENCODE_BASE_URL="https://opencode.ai/zen/go/v1/chat/completions"

yoke

CLI Flags & REPL :

yoke -e opencode -m deepseek-chat
# Or switch live in REPL:
/endpoint opencode

C. Local Models (SGLang, Ollama, LM Studio, vLLM)

Run yoke completely offline against local LLM servers without requiring API keys:

SGLang ( http://localhost:30000 ) :

yoke -e http://localhost:30000/v1 -m deepseek-ai/DeepSeek-V3

Ollama ( http://localhost:11434 ) :

# 1. Start Ollama model
ollama run qwen2.5-coder:14b

# 2. Launch yoke with local endpoint
yoke -e ollama -m qwen2.5-coder:14b

# Or via environment variables:
export OLLAMA_HOST="http://localhost:11434"
export DEEPSEEK_MODEL="qwen2.5-coder:14b"
yoke

LM Studio ( http://localhost:1234 ) & vLLM ( http://localhost:8000 ) :

yoke -e lmstudio -m qwen2.5-coder-32b-instruct
# OR
yoke -e vllm -m deepseek-r1-distill-qwen-32b

Automatic Reasoning & Tag Extraction : Local models and OpenRouter models that return reasoning inside ... tags are automatically parsed into [Reasoning] output.

API Key Bypass : Local loopback endpoints ( localhost , 127.0.0.1 , ::1 , 192.168.* ) do not require API keys and automatically bypass offline mock mode.


Key Features & Capabilities

Persistent Session Resumption ( yoke -c & /resume )

  • Every session is assigned a unique UUID (e.g. df97eb34-cb33-4f21-bada-2e9c3cf75d46 ).
  • On exit, yoke prints your conversation ID:
      Resume with -c (or command below):
      yoke --conversation=df97eb34-cb33-4f21-bada-2e9c3cf75d46
      
  • Resume any conversation across restarts with yoke -c or interactively pick past sessions in the REPL via /resume .
  • Conversations are stored in lmml (a Markdown-superset markup for LLM conversations) as .lmml narratives under .yoke/sessions/ — plain, self-contained Markdown that any Markdown viewer renders sensibly, yet round-trips every structured message losslessly through its inline-embed model. Legacy .json session files from earlier versions are still read transparently on resume.

Scoped Rule Engine ( /rules )

  • Manage prompt preambles and execution constraints.
  • Scopes :
    • all: — Applied to all user prompt turns (e.g. all: typographic quotes “” mean the exact quote ).
    • : — Applied only when executing specific commands (e.g. cr: format table cells multiline to fit in 80 symbols width for /cr ).
  • Use /rules to list rules, /rules add to add rules, and /rules delete to launch the interactive checkbox modal.

Context Reference Expansion ( @ ) & Smart Error Resolution

  • Type @filename , @/path , @file://... , or @https://... anywhere in user prompts to attach contents.
  • @ triggers an interactive TUI file picker filtered by .gitignore rules (excluding _build , deps , .elixir_ls ).
  • Intelligently expands ambiguous error references ("error above", @error ) and tracks :open vs :resolved issue status across tool calls.

Interactive Question TUI Modal ( ask_question )

  • Allows the AI model to request user feedback, clarify requirements, or present multi-choice design decisions with keyboard navigation and OK/Cancel buttons.

Model Context Protocol (MCP) & First-Class Ragex Integration

  • Mount external Model Context Protocol (MCP) servers via stdio (JSON-RPC) or HTTP/SSE.
  • Native integration with Ragex for SCIP code indexing, AST refactoring, and semantic code search ( /ragex ).

One-Command Global Installation & Updates

  • Install globally to ~/.local/bin/yoke via mix yoke.install or install.sh .
  • Run yoke smoothly from any workspace directory.
  • Perform background in-place self-updates anytime using yoke --update or /update .

Pure Console Mode ( !! )

  • Type !! on its own line to flip yoke completely out of the way: no Brain/Hands actors, no LLM turns, no slash-command dispatch -- just a bare sh -c passthrough with live-streamed output.
  • cd is applied to yoke 's own process, exactly like a real shell builtin, so navigation persists across commands.
  • Type !! again (or Ctrl+D ) to flip straight back into the harness REPL -- no need to open a second terminal tab for a quick burst of plain shell commands.

Concurrent OTP Task Engine

  • Tool call batches execute concurrently under Yoke.TaskEngine.Orchestrator , each in its own supervised Task , with automatic per-file write locking to prevent concurrent edit races.
  • The idle status bar surfaces a live "N running" badge with per-task summaries whenever background tool work is in flight.

Native Elixir Static Analysis ( /linter , /lint )

  • Runs oeditus_credo , propwise , credo , or dialyzer against the full project, a git diff, or a branch code review via /linter [project|diff|cr] [args...] .

Configurable Prompt Styles & Status Bar ( /config )

  • Switch prompt layout with /config style or supply a fully custom template via /config prompt