Modular, model-agnostic AI coding agent runtime
pip install parallax-agent==0.1.5 Copy PIP instructions
A modular, model-agnostic AI coding-agent runtime designed to power CLI, desktop, and web applications.
Parallax is being built as a serious AI engineering project rather than as a single-purpose coding CLI.
The central idea is to separate the agent runtime from the interface that users interact with. The runtime should understand how to reason over a task, interact with a repository, use tools, manage context, call different models, coordinate subagents, interact with MCP servers, execute code safely, and maintain run state. The CLI, desktop application, and web application should all consume the same core runtime.
pip install parallax-agent Or install with uv:
uv add parallax-agent 1. Configure Inference Providers Parallax supports Groq (ultra-fast inference with free tier at console.groq.com) and OpenRouter (200+ models from Anthropic, OpenAI, Meta at openrouter.ai):
# Launch interactive onboarding wizard parallax config setup # Or set provider API keys directly: parallax config set groq gsk_... parallax config set openrouter sk-or-... Keys are stored with secure user-only permissions (0o600) in ~/.parallax/config.json. You can also configure them via environment variables (GROQ_API_KEY, OPENROUTER_API_KEY, or local .env).
Execute autonomous problem-solving directly in your repository:
# Execute a task autonomously parallax "Fix the failing authentication tests in this repository" # Choose a specific model parallax -m groq/llama-3.3-70b-versatile "Refactor the database queries" 3. Interactive Multi-Turn REPL Launch the flagship developer REPL:
parallax # or parallax chat Inside the interactive console:
Parallax automatically persists all multi-turn sessions with atomic 0o600 writes in ~/.parallax/sessions/:
# List all saved sessions parallax sessions # Resume the most recent session parallax resume latest # or parallax -r latest # Resume a specific session by ID or prefix parallax resume sess_20261013_140532 # or parallax -r 140532 # Resume a session and execute a followup single-shot task parallax run --resume latest "Now run pytest and verify all tests pass" # Delete a saved session parallax sessions --delete sess_20261013_140532 Project Vision Parallax aims to become a reusable AI agent runtime rather than merely another coding-agent interface.
The runtime should eventually be capable of taking a task such as:
Fix the failing authentication tests in this repository. and autonomously:
The same runtime should be usable through multiple interfaces:
┌─────────────────────────┐ │ Parallax Core │ │ │ │ Agent Runtime │ │ Model Layer │ │ Tool System │ │ Context Engine │ │ Repository Intel │ │ MCP │ │ Subagents │ │ Sandbox │ │ Persistence │ │ Evals │ │ Observability │ └────────────┬────────────┘ │ ┌───────────────────┼───────────────────┐ │ │ │ ▼ ▼ ▼ CLI Desktop Web Python first Tauri + TS/ Next.js + TS Rust later The core is the product's technical foundation. The interfaces are consumers of that foundation.
AI coding agents are no longer simply chat interfaces with code generation.
A capable coding agent needs to operate inside an environment:
This makes the interesting engineering problem much larger than:
prompt → LLM → answer Parallax is intended to explore the complete system:
User Task ↓ Agent Runtime ↓ Context + Repository State ↓ Model ↓ Tool Calls ↓ Execution Environment ↓ Tool Results ↓ State Update ↓ Context Rebuild ↓ Model ↓ ... ↓ Verified Result The project is also intentionally designed as a learning vehicle for modern AI engineering.
The goal is not to hide the mechanics behind an agent framework from day one. The core runtime will initially be implemented directly so that the underlying concepts are understood before abstractions are introduced.
Parallax Core should not know or care whether it is being used by a CLI, desktop application, web application, or another program.
from parallax import Agent agent = Agent( model="...", tools="auto", ) result = await agent.run( "Fix the failing authentication tests." ) The interface consuming the runtime decides how that result is displayed.
CLI └── renders AgentEvents in the terminal Desktop └── renders AgentEvents in a graphical UI Web └── streams AgentEvents over WebSocket/SSE This prevents UI concerns from leaking into the runtime.
┌─────────────────────────────────────────────────────────────┐ │ Interfaces │ │ │ │ CLI Desktop Web │ └───────────────┬───────────────┬───────────────┬─────────────┘ │ │ │ └───────────────┼───────────────┘ │ Runtime API │ ┌───────────────────────────────▼─────────────────────────────┐ │ PARALLAX CORE │ │ │ │ Agent Runtime │ │ ├── State │ │ ├── Execution Loop │ │ ├── Termination │ │ ├── Budgets │ │ ├── Retries │ │ └── Cancellation │ │ │ │ Model Layer │ │ ├── Provider abstraction │ │ ├── Streaming │ │ ├── Tool calling │ │ └── Usage │ │ │ │ Tool System │ │ ├── File tools │ │ ├── Search tools │ │ ├── Shell tools │ │ ├── Git tools │ │ └── Test tools │ │ │ │ Context Engine │ │ ├── Context budgeting │ │ ├── History │ │ ├── Compaction │ │ └── Repository instructions │ │ │ │ Repository Intelligence │ │ ├── File discovery │ │ ├── Symbol search │ │ ├── AST analysis │ │ └── Code indexing │ │ │ │ MCP │ │ ├── Servers │ │ ├── Tools │ │ └── Resources │ │ │ │ Agents │ │ ├── Subagents │ │ ├── Delegation │ │ └── Parallel execution │ │ │ │ Sandbox │ │ ├── Process isolation │ │ ├── Filesystem boundaries │ │ └── Network permissions │ │ │ │ Persistence │ │ ├── Sessions │ │ ├── Runs │ │ ├── Messages │ │ └── Checkpoints │ │ │ │ Evals + Observability │ └───────────────────────────────┬─────────────────────────────┘ │ Optional Platform │ ┌───────────────────────────────▼─────────────────────────────┐ │ PARALLAX PLATFORM │ │ │ │ API │ │ Authentication / OAuth │ │ Users / Organizations │ │ Model access policies │ │ Usage / quotas │ │ Billing │ │ Metrics │ │ Cloud persistence │ └─────────────────────────────────────────────────────────────┘ Repository Structure Current Codebase (src/ Package Layout) Parallax is organized as an installable package (src/parallax) providing a headless agent runtime decoupled from user interfaces:
parallax/ ├── src/ │ └── parallax/ # Main installable package │ ├── __init__.py # Public exports (Agent, Session, SessionStore, etc.) │ ├── core/ # Headless agent runtime (zero UI dependencies) │ │ ├── agent.py # Agent coordinator & high-level run methods │ │ ├── run.py # Asynchronous execution loop (100 max iterations) │ │ ├── session.py # Session model & atomic 0o600 disk persistence │ │ ├── llm.py # Multi-provider client (Groq + OpenRouter) │ │ ├── environment.py # LocalEnvironment runtime abstraction │ │ ├── tool.py # Tool decorator & schema extraction │ │ ├── types.py # Typed dataclasses (Message, AgentEvent, ToolCall) │ │ ├── errors.py # Domain error hierarchy │ │ ├── tools/ # Core tools (bash, editor, search) │ │ └── context/ # Token estimation, compactor, manager │ └── cli/ # Flagship interactive terminal interface │ ├── app.py # Typer CLI entrypoint & commands │ ├── repl.py # prompt_toolkit REPL with live autocomplete │ ├── config.py # Multi-provider config & onboarding wizard │ ├── renderer.py # Clean high-signal terminal event renderer │ ├── console.py # Flagship landing hero card & status │ ├── doctor.py # System health & connectivity diagnostics │ └── theme.py # Minimalist theme & symbols ├── tests/ # Comprehensive test suite (201+ unit & e2e tests) ├── pyproject.toml # Dependencies, packaging & build configuration ├── PLAN.md # Roadmap and execution tracking ├── LEARNING.md # Engineering study guide & applied learnings └── README.md Intended Long-Term Monorepo Evolution As interfaces and services expand (CLI, Web, Desktop), the architecture will evolve into a workspace structure:
parallax/ │ ├── packages/ │ ├── parallax-core/ # Headless runtime package │ │ └── src/ │ │ └── parallax/ │ │ ├── runtime/ │ │ ├── models/ │ │ ├── tools/ │ │ ├── context/ │ │ ├── repository/ │ │ ├── mcp/ │ │ ├── agents/ │ │ ├── persistence/ │ │ └── evals/ │ │ │ └── parallax-cli/ # Rich interactive terminal interface │ └── src/ │ └── parallax_cli/ │ ├── apps/ │ ├── web/ # Next.js web application │ └── desktop/ # Tauri / Rust desktop client │ ├── services/ │ └── api/ # Headless API service │ ├── evals/ ├── docs/ ├── README.md ├── pyproject.toml └── uv.lock The project grows incrementally, keeping the runtime clean and headless at every stage.
The runtime is the most important component in Parallax.
class Agent: async def run(self, task: str) -> AgentResult: ... The runtime is responsible for:
Agent = Model + State + Tools + Environment + Context Policy + Execution Loop + Termination Policy Agent Execution Model The fundamental loop is:
┌──────────────┐ │ User Task │ └──────┬───────┘ │ ▼ ┌─────────────────┐ │ Build Context │ └────────┬────────┘ │ ▼ ┌─────────────────┐ │ Model │ └────────┬────────┘ │ ┌─────────┴─────────┐ │ │ ▼ ▼ Final Response Tool Calls │ │ │ ▼ │ ┌─────────────┐ │ │ Execute │ │ │ Tools │ │ └──────┬──────┘ │ │ │ ▼ │ ┌─────────────┐ │ │ Tool Result │ │ └──────┬──────┘ │ │ │ ▼ │ Update State │ │ │ └──────────┐ │ │ └──────────────────────────────┘ │ ▼ Continue / Stop A simplified runtime can eventually look like:
model system prompt tool registry context manager policies runtime configuration AgentRun One execution:
task messages tool calls tool results iteration count usage events status checkpoints final result Conceptually:
Agent ├── Model ├── Tools ├── Context Manager └── Policies │ ├── Run #1 ├── Run #2 └── Run #3 This prevents conversation state from being permanently attached to the agent configuration.
The runtime should not be tightly coupled to one provider.
A model abstraction should eventually provide:
generate() stream() tool calling structured output token usage context limits model metadata Conceptually:
class Model: async def generate( self, messages, tools=None, ) -> ModelResponse: ... Potential providers may include:
The model layer should expose capabilities such as:
provider model_id context_window supports_tools supports_streaming supports_vision input_cost output_cost Tool System Tools are the bridge between the model and the environment.
name description input schema function execution policy result metadata Example:
@tool def read_file(path: str) -> str: """Read a file from the repository.""" ... The runtime should transform this into a provider-compatible schema:
{ "type": "function", "function": { "name": "read_file", "description": "Read a file from the repository.", "parameters": { "type": "object", "properties": { "path": { "type": "string" } }, "required": ["path"] } } } Tool execution should eventually support:
A tool failure should normally become model-visible feedback rather than crashing the entire agent.
read_file write_file edit_file list_files search_code shell git run_tests Later:
inspect_ast search_symbols find_references apply_patch run_linter run_formatter inspect_dependencies query_docs Repository Intelligence A coding agent needs more than raw text retrieval.
Parallax should eventually understand repositories through multiple layers.
directories files file metadata .gitignore configuration Layer 2 --- Text Search grep-like search regex search keyword search filename search Layer 3 --- Structural Search functions classes methods imports symbols references Layer 4 --- AST Tree-sitter and similar parsing technologies can provide language-aware structure.
file ├── imports ├── defines ├── references ├── tests └── dependencies This allows Parallax to reason about a repository structurally instead of repeatedly reading arbitrary files.
Context is one of the central engineering problems in coding agents.
The runtime cannot simply append everything it sees to the prompt forever.
What information does the model need right now to make the next decision?
Repository │ ├── relevant files ├── symbols ├── search results ├── previous actions ├── tool results └── task information │ ▼ Context Manager │ ▼ Model Context RAG RAG will primarily support repository intelligence and contextual retrieval.
Repository ↓ Parse / Chunk ↓ Metadata ↓ Embeddings ↓ Vector Index ↓ Hybrid Retrieval ↓ Reranking ↓ Context Manager ↓ LLM Parallax should not depend exclusively on vector search.
Therefore the long-term approach should support hybrid retrieval.
Model Context Protocol will be an important interoperability layer.
Parallax should eventually support MCP servers for capabilities such as:
documentation databases browser tools issue trackers internal tools developer services The MCP subsystem should handle:
server discovery connection lifecycle tool discovery tool execution resources prompts transport authorization errors Parallax should use an established MCP implementation rather than reimplementing the protocol itself.
The runtime's responsibility is to integrate MCP capabilities into its own tool/context model.
Complex tasks can eventually be delegated to specialized agents.
Main Agent │ ┌─────────┼─────────┐ │ │ │ ▼ ▼ ▼ Research Coding Testing Agent Agent Agent Potential responsibilities:
Research Agent └── investigate repository / documentation Coding Agent └── implement changes Testing Agent └── run and analyze tests Review Agent └── inspect resulting changes The system should support:
Subagents should be introduced only after the single-agent runtime is stable.
A coding agent can execute arbitrary commands and modify arbitrary files.
filesystem restrictions working-directory restrictions command allowlists environment isolation network restrictions resource limits process isolation secret protection permission prompts A future sandbox may use containerization or another isolated execution environment.
Tool execution should be treated as a security boundary rather than assuming model-generated commands are trustworthy.
Sessions are first-class runtime objects in Parallax, completely decoupled from UI and terminal libraries.
run_started model_started model_delta model_completed tool_started tool_output tool_completed tool_failed file_changed test_started test_completed agent_message agent_error run_completed run_cancelled Example:
async for event in agent.run_stream(task): ... The CLI could render these events directly.
The desktop application could subscribe through a local process boundary.
The web application could receive the same event stream through WebSocket or SSE.
This keeps the runtime independent of presentation.
Parallax should eventually contain its own evaluation system.
For coding agents, useful evaluation signals include:
task completion tests passing files correctly modified regressions tool errors iterations latency token usage cost human intervention A benchmark task might look like:
Repository: example-project Task: Fix issue #42 Expected: - tests pass - regression test exists - unrelated files unchanged The evaluation harness should make it possible to compare:
model A vs model B prompt A vs prompt B runtime version A vs runtime version B tool strategy A vs tool strategy B without relying only on subjective manual testing.
Agent systems are difficult to debug without structured telemetry.
run duration model latency time to first token input tokens output tokens cached tokens estimated cost tool latency tool failures iterations context size subagent activity MCP activity Tracing should make it possible to understand:
Run ├── Model call │ ├── context size │ ├── latency │ └── usage │ ├── Tool call │ ├── command │ ├── duration │ └── result │ ├── Model call │ └── Final result OpenTelemetry is a possible foundation for standardized tracing.
parallax "Fix the authentication tests" Potential commands:
parallax parallax run "Fix this bug" parallax inspect parallax session parallax config parallax models parallax mcp parallax eval The CLI should remain thin.
The desktop application is a future interface.
Tauri ├── Rust host ├── TypeScript/React UI └── Parallax Core process Potential capabilities:
The desktop application should consume the same core rather than implementing another agent runtime.
Next.js TypeScript FastAPI Parallax Core PostgreSQL Conceptually:
Browser │ ▼ Next.js │ ▼ API │ ▼ Parallax Runtime │ ├── Model Providers ├── Tools ├── MCP └── Repository The web application introduces additional platform concerns such as:
These concerns should not be embedded into the local core.
The platform layer is optional and sits outside the core runtime.
API Authentication OAuth / OIDC Users Organizations Permissions Model access policies Usage tracking Quotas Billing Cloud persistence Metrics Rate limiting For example, a hosted Parallax service could decide:
User A └── can use models X and Y User B └── can use models X, Y and Z Organization C └── has a monthly token quota The core runtime should instead receive the effective configuration and execute the run.
Local Parallax ↓ user's API key user's repository local execution Hosted Parallax ↓ platform authentication platform model gateway cloud persistence remote execution Both can use the same runtime architecture.
user session run provider model input tokens output tokens cached tokens cost latency This enables policies such as:
allowed models token limits rate limits usage quotas provider restrictions organization policies The runtime itself should remain capable of running independently.
Python Python is the initial choice because of its AI/LLM ecosystem, async support, rapid iteration, and broad developer tooling.
Python Typer Rich Potential future native CLI:
Rust Rust should not be introduced into the runtime prematurely.
A native Rust CLI may eventually make sense for startup performance, distribution, native system integration, or tighter process management. Until then, a Python CLI keeps the architecture simpler.
Next.js React TypeScript Tailwind CSS FastAPI Data Local:
pgvector Redis should be introduced only when a real workload requires it.
Docker Docker Compose GitHub Actions Vercel Cloud infrastructure as required Infrastructure should not become the focus before the runtime itself is mature.
Build the runtime before building multiple UIs.
CLI + Web + Desktop + Core simultaneously 2. Interface independence The core should not contain React, Next.js, terminal formatting, HTTP route handlers, or browser-specific logic.
Do not hardcode the runtime around one provider.
local repository local filesystem user-owned API keys local persistence without requiring a hosted Parallax account.
Agent state should be inspectable and structured.
Avoid hiding important runtime behavior behind opaque abstractions.
streaming parallel tools MCP subagents cancellation concurrent operations Therefore asynchronous execution should be adopted early.
The runtime emits events. Clients decide how those events are rendered.
Any capability that can execute commands, modify files, access networks, or read secrets must be treated as privileged.
Early versions should intentionally implement core mechanics directly. Frameworks can be evaluated and introduced after the underlying architecture is understood.
Python uv project structure environment management typing dataclasses Pydantic pytest asyncio Phase 1 --- Minimal Agent Runtime Implement:
LLM request message state tool schemas tool registry tool execution tool results iteration loop termination Initial runtime:
LLM ↓ Tool Call ↓ Tool ↓ Result ↓ LLM Phase 2 --- Runtime Robustness Add:
async execution max iterations timeouts tool errors structured ToolResult retry handling Agent AgentRun cancellation Phase 3 --- Coding Agent Add:
AgentEvent streaming model output tool lifecycle events file change events execution timing usage tracking structured logs Phase 5 --- Context Engineering Add:
context manager token budgets history management repository instructions context compaction summarization progressive disclosure Phase 6 --- Repository Intelligence Add:
Tree-sitter symbol indexing AST analysis reference search repository graph hybrid retrieval Phase 7 --- RAG Add:
embeddings vector search lexical retrieval hybrid retrieval reranking repository indexing Phase 8 --- MCP Add:
MCP client server configuration tool discovery resource discovery tool execution permissions Phase 9 --- Subagents Add:
delegation agent roles parallel agents handoffs shared state subagent budgets Phase 10 --- Sandboxing Add:
process isolation filesystem isolation network policy resource limits permission model secret protection Phase 11 --- Persistence Add:
sessions runs checkpoints SQLite run recovery history Phase 12 --- Evals Add:
benchmark tasks automated graders regression suite runtime comparisons model comparisons tool effectiveness measurements Phase 13 --- Observability Add:
structured logging metrics tracing token accounting cost tracking latency tool analytics Phase 14 --- Interfaces Build:
CLI ↓ Desktop ↓ Web while keeping the core unchanged.
FastAPI authentication OAuth/OIDC users organizations model gateway usage policies quotas cloud persistence billing This phase should happen only after the core runtime is mature.
OpenRouter model call ↓ tool schema generation ↓ tool registration ↓ LLM tool calling ↓ tool execution ↓ tool result ↓ LLM continuation The prototype uses Python and an OpenRouter client.
The current code is a learning implementation and is expected to be refactored into the parallax-core package.
fix tool registration fix provider-compatible message serialization introduce a proper Tool abstraction introduce model abstraction make runtime asynchronous add max iterations add tool error handling add structured ToolResult separate Agent from AgentRun The prototype should not be discarded. It is the seed from which the runtime is being built.
async for event in agent.run_stream( "Fix the failing authentication tests." ): print(event) The exact API is expected to evolve as the runtime becomes more capable.
Parallax is deliberately designed to develop practical AI engineering skills.
typing dataclasses Pydantic asyncio subprocess filesystem APIs packaging testing logging LLM engineering messages tool calling structured output streaming context windows tokens model capabilities provider abstraction Agent engineering agent loops state machines tool execution termination retries context management planning delegation subagents Coding-agent engineering Git patches diffs repository search ASTs tests build systems code indexing Retrieval embeddings vector search BM25 hybrid retrieval reranking RAG Systems engineering processes sandboxing IPC concurrency cancellation persistence event systems Backend engineering Later:
REST WebSockets SSE authentication OAuth sessions databases rate limiting quotas Production AI engineering observability tracing evaluations cost tracking model routing security reliability What Parallax Will Not Reinvent The project should build important AI-agent abstractions itself for learning purposes, but should not waste time reimplementing mature foundational technology.
agent execution loop agent state tool registry abstraction runtime policies context management event system agent orchestration subagent orchestration usage accounting run persistence evaluation harness model abstraction Use mature libraries/protocols HTTP TLS cryptography Git Tree-sitter Docker MCP protocol OAuth/OIDC database drivers tokenizers LLM inference provider SDKs The objective is to understand the architecture without unnecessarily rebuilding foundational infrastructure.
PARALLAX │ ┌──────────────┴──────────────┐ │ │ Parallax Core Parallax Platform │ │ Agent Runtime API / Auth Model Layer Users / Orgs Tool System Usage / Quotas Context Engine Model Gateway Repository Intel Cloud Persistence MCP Billing Subagents Metrics Sandbox Persistence Evals Observability │ ┌───────┼────────┐ │ │ │ CLI Desktop Web The final system should make it possible to use the same agent runtime in multiple environments:
Local developer ↓ Parallax CLI ↓ Parallax Core or:
Developer ↓ Parallax Desktop ↓ Parallax Core or:
Developer ↓ Parallax Web ↓ Parallax API ↓ Parallax Core The runtime remains the common foundation.
Parallax is not being built simply to produce another chatbot or another wrapper around an LLM API.
The project is intended to answer a deeper engineering question:
What does it take to build a robust, model-agnostic AI agent runtime capable of operating inside real software repositories?
That means understanding and implementing the systems around the model:
Models + Tools + State + Context + Environment + Repository Intelligence + Memory + MCP + Subagents + Security + Evaluation + Observability The LLM is one component of the system.
⚡ Core Runtime & CLI Operational (v0.1.5 Released on PyPI)
The core headless runtime and flagship terminal CLI are fully implemented, thoroughly tested, and packaged:
Next Milestone: AST & Repository Intelligence (Phase 6), MCP Integration (Phase 8), and Sandbox Hardening (Phase 10).
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.




