01 · hydra
multi-model CLI engine · interactive terminal agent · model gateway routerOne engine that runs in five practical forms: a single command-line prompt, an interactive terminal agent, a multi-model swarm, a local OpenAI-compatible gateway, and a background daemon. A background daemon runs on local hardware right now, using Hydra to build and verify Alice. That daily production work is why Hydra leads this page.
escaping vendor lock-in and unifying fragmented model backends
Connecting to modern AI models requires juggling incompatible client libraries, disparate cloud dashboards, rate limits, and fragile secrets. When a remote API outage strikes during an agent run, entire engineering workflows collapse. Proprietary coding assistants inject closed telemetry, hide underlying prompts, and force dependence on a single provider. We built Hydra to give developers a unified, sovereign interface that routes prompts across frontier models, free edge providers, and offline inference backends with zero third-party dependencies, automatic failover, and local privacy.
six core functions for model routing and terminal automation
multi-model routing
Type one short command to send your prompt to any local or cloud model. Hydra uses clean aliases like hydra sonnet 5.5, hydra opus 5.5 high, or hydra sol 6.1 pro. If your primary connection drops or runs out of credits, Hydra steps down the ladder automatically: OpenRouter first, then Vercel AI Gateway, and then Cloudflare Workers AI, while stripping secret keys and file paths from error logs.
prompt execution
Streams incoming words directly to your terminal screen as the model generates them. You can adjust reasoning effort with flags like --effort high or --reasoning-mode pro, or request machine-readable output with --json. You can also pipe file content directly into Hydra from standard input: cat file.py | hydra <alias> passes source code into the model, and cat log.txt | hydra sol 6.1 - "audit errors" attaches review instructions to the streamed input.
interactive tui terminal mode
Type hydra agent or hydra -i to launch an interactive coding loop in your terminal. The input box stays pinned at the bottom of the screen beneath normal scrollback, showing the active model, current folder, repository rules, and session ID. Press Ctrl+Space for voice dictation. Press Enter to send. Press Enter a second time while the model generates to redirect it mid-flight. Press Ctrl+C to cancel. Slash opens commands, and a status gauge tracks remaining context.
continuous swarms
Divides a single engineering task across multiple parallel model roles with hydra swarm. An Architect plans the system layout, a Coder writes the code, an Auditor checks the diff for bugs and missed edge cases, and a Synthesizer pulls the verified work into one cohesive pull request. Adding the --agentic flag lets swarm heads run command-line tools and edit files directly.
background orchestrator daemon
A scheduled process that runs continuous engineering loops without keeping a browser open. Run hydra orchestrator to let Hydra take in tasks, run automated test suites, review new commits, and write structured progress logs to disk unattended. A background daemon runs on local hardware right now, using Hydra to build and verify Alice.
openai api server on port 7777
Run hydra serve --port 7777 to start a lightweight local HTTP server that looks and behaves like the OpenAI API. External programming tools, shell runners, and agent scripts such as Hermes and Pi connect directly to 127.0.0.1:7777. Hydra handles alias translation, upstream model failover, token streaming, and local tool execution without external packages.
ten interconnected model providers, inference engines, and cognitive runners
Anthropic models for high-level architectural planning, complex reasoning, and code refactoring. Call them with clean aliases and adjust reasoning effort from low to max.
OpenAI reasoning model. Choose pro mode and high reasoning effort when verifying mathematical invariants, auditing security rules, or running adversarial reviews.
Powers hydra free at zero cost by sending queries to Meta Llama 3.3 70B Instruct running on Cloudflare global edge hardware.
Unified connection to hundreds of models, serving as our primary router for commercial models and as an automatic zero-cost fallback querying open-access Gemma 4 and Nemotron models when cloud quotas run out.
Low-latency edge routing layer that switches automatically to alternative providers if an upstream API fails, keeping agent pipelines online.
Routes prompts through hydra hf to run open-weight model endpoints on Hugging Face without managing dedicated servers.
Low-cost inference access and specialized GLM-5.3 models that keep token costs low during high-volume batch runs and continuous test suites.
Runs models completely offline with hydra local, connecting directly to local Ollama, llama.cpp, or EasyLM sockets with zero internet data transfer.
Breaks input queries into discrete factual statements and evaluates them against deterministic tool pipelines before remote model generation begins.
Built-in standard input and output client connecting Model Context Protocol tools for Filesystem, Fetch, SQLite, Git, GitHub, Brave Search, Memory, and Playwright, paired with nine zero-dependency native coding tools.
five structural advantages of multi-headed model routing
sovereign local data privacy
Zero third-party telemetry, tracking scripts, or background data collection. Prompts and tokens stay strictly on your local hardware during offline inference. Child tool processes run with clean environments so secret API tokens cannot leak.
compute tiering economics
Cuts token costs by routing mechanical transforms, syntax checks, and file searches to free cloud tiers or local models. Expensive frontier models turn on only when deep reasoning or architectural auditing requires them.
cross-model consensus verification
Eliminates single-model blind spots. Multi-agent swarms compare outputs from different model families, verifying code patches and software architecture through independent auditing and automated consensus.
zero vendor lock-in
Built with the standard libraries of Python and Node with zero external dependencies. Switching model providers, changing endpoints, or upgrading models requires no application code changes.
offline fallback
Maintains uninterrupted work during network outages or field work on air-gapped computers. When internet access drops, commands route immediately to local model backends so active workflows keep running.
five practical workflows for autonomous engineering and research
autonomous coding swarms
Parallel refactoring with specialized model roles: Opus models system architecture, Sonnet writes production code and tests, GPT-6.1 Sol audits security vulnerabilities, and Gemini synthesizes the verified release.
continuous overnight research daemons
Background orchestrator loops that poll technical feeds, download academic papers, extract factual propositions through Alice, and write structured markdown summaries while you sleep.
terminal workflow automation
Direct command-line pipes where compiler errors, test failure traces, git diffs, and server logs stream directly into reasoning models for immediate root-cause diagnostics.
multi-model code review and refactoring
Comparing independent model families on pull requests, ensuring that architecture rules and edge cases pass multi-model code review before merging.
deterministic knowledge graph ingestion
Extracting propositions from raw documentation through Alice cognitive grammar and recording structured entities directly into MCP Memory graphs or local SQLite stores for deterministic knowledge graph ingestion.
terminal agent view pinned beneath native scrollback
Current idle composer. The mark, model, directory, detected rules, and session sit above the pinned prompt. Ctrl+Space dictates. Enter sends. A second Enter steers a running turn. Slash opens commands.
copy-ready terminal commands and programmatic sdk examples
# summon claude sonnet 5.5 with default streaming: $ hydra sonnet 5.5 "Implement a zero-copy ring buffer in Rust" # summon claude opus 5.5 with high reasoning effort: $ hydra opus 5.5 high "Verify distributed raft state machine invariants" # summon gpt-6.1 sol with pro reasoning mode: $ hydra sol 6.1 pro "Audit authentication token validation logic for side channels" # pipe source code directly into model with trailing instruction: $ cat src/parser.c | hydra sonnet 5.5 - "Identify potential memory leaks"
# launch interactive coding agent repl pinned beneath scrollback: $ hydra agent # launch with interactive in-flight tool confirmation: $ hydra agent --steer # run single autonomous agent task with native file and bash tools: $ hydra agent "Inspect pyproject.toml and add coverage scripts" # summon specific model with model context protocol tools enabled: $ hydra sonnet 5.5 --mcp "Search sqlite database for stale sessions"
# fan out across default architect, coder, auditor, and synthesizer heads: $ hydra swarm "Design and test an async event dispatcher" # delegate specialist heads to hermes and pi cli binaries: $ hydra swarm "Refactor parser" --heads architect:hermes,coder:pi,auditor # enable autonomous tool-augmented execution loops across swarm heads: $ hydra swarm "Fix security vulnerabilities" --agentic
# 1. launch sovereign openai gateway on port 7777: $ hydra serve --port 7777 # 2. point external agents like hermes, pi, goose, or aider to hydra: $ export OPENAI_BASE_URL="http://127.0.0.1:7777/v1" $ export OPENAI_API_KEY="sovereign-hydra" # 3. list registered models and aliases: $ curl http://127.0.0.1:7777/v1/models # 4. send chat completion with automatic alias resolution: $ curl http://127.0.0.1:7777/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{"model":"sonnet 5.5","messages":[{"role":"user","content":"ping"}]}'
# zero-cost cloud inference via cloudflare / openrouter free forge: $ hydra free "Explain the Byzantine Generals problem" # completely offline local inference via ollama / llama.cpp: $ hydra local "Write a unit test for email validation" # hugging face serverless inference routing: $ hydra hf "Summarize git log output" # zero-cost agent loop with native file and bash tools: $ hydra agent --free "Lint repository python files" # offline local agent loop with no external network calls: $ hydra agent --local "Format markdown files"
# initialize default community mcp servers template in ~/.hydra: $ hydra mcp init # inspect registered mcp servers and exposed tools: $ hydra mcp list # test connection and tool discovery on filesystem server: $ hydra mcp test filesystem # test web fetch server: $ hydra mcp test fetch # summon model with live brave search mcp tool: $ hydra sonnet 5.5 --mcp "Search brave for latest rust release notes"
# python standard library programmatic invocation: from hydra_cli import complete, run_agent_loop, McpRegistry # direct synchronous prompt completion: response = complete("sonnet 5.5", "Explain memory barriers") print(response) # autonomous tool-augmented agent loop: registry = McpRegistry() result = run_agent_loop("opus 5.5 high", "Audit codebase", registry=registry) registry.shutdown() print(result)
install python and node packages with zero external dependencies
# python global or virtualenv install from git: $ pip install "git+https://github.com/erastudil/hydra.git" # or node global cli install: $ npm install -g "git+https://github.com/erastudil/hydra.git" # direct linux / macos bootstrap script: $ curl -fsSL https://raw.githubusercontent.com/erastudil/hydra/main/install.sh | bash # direct windows powershell bootstrap script: PS> irm https://raw.githubusercontent.com/erastudil/hydra/main/install.ps1 | iex
source: github.com/erastudil/hydra · packages: hydra-ai-cli · hydra-agent-cli