AleutianFOSS

command module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 11, 2026 License: AGPL-3.0 Imports: 1 Imported by: 0

README

Aleutian: Code Intelligence for Local LLMs

Aleutian gives your local LLM deep understanding of any codebase. It parses source code into a call graph, indexes symbols into a vector database, and exposes 24+ agent tools through an OpenAI-compatible API. Any tool that speaks the OpenAI protocol — Open WebUI, Continue.dev, Aider, Cline, curl — gets structural code intelligence without plugins or custom integrations.

Ask "what are the callees of the main function?" and get an accurate, sourced answer from the actual code graph — not an LLM hallucination.

How It Works

Your Code → [Tree-sitter AST] → [Call Graph + Symbol Index] → [Weaviate Vector DB]
                                                                      ↓
Open WebUI / Continue / Aider → [Trace Proxy :12218] → [Agent Loop] → [24+ Tools]
                                    OpenAI API            CRS Reasoning    ↓
                                                                    [LLM Synthesis]
  1. Parse — Tree-sitter extracts every function, method, type, and interface from your source code (Go, Python, JS/TS, Java, Rust, C/C++)
  2. Graph — Builds a call graph with edges for calls, implementations, and references
  3. Index — Embeds all symbols into Weaviate for semantic search ("find code related to authentication")
  4. Agent — A multi-step reasoning loop selects the right tools (graph queries, semantic search, analytics) and synthesizes answers using your local LLM
  5. Proxy — Translates OpenAI /v1/chat/completions requests into agent loop calls, so any compatible client works out of the box

Quick Start

Prerequisites
  • Podman and podman-compose
  • Ollama running on the host with at least one model pulled (e.g., ollama pull gemma3n)
  • Go 1.25+ (to build from source)
1. Build the CLI
git clone https://github.com/AleutianAI/AleutianFOSS.git
cd AleutianFOSS
go build -o aleutian ./cmd/aleutian
2. Start the stack

Point TRACE_PROJECTS_DIR at the codebase you want to analyze:

TRACE_PROJECTS_DIR=/path/to/your/project ./aleutian stack start --build

This starts all services: trace server, trace proxy, orchestrator, Weaviate, NATS, and Jaeger. The proxy automatically parses your code, builds the call graph, and indexes all symbols on startup.

3. Verify
# Check all services are healthy
curl http://localhost:12218/health

# Ask a question via curl
curl -s http://localhost:12218/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemma3n",
    "messages": [{"role": "user", "content": "What are the entry points in this project?"}]
  }'
4. Connect a UI (optional)

Open WebUI:

podman run -d --name open-webui -p 3001:8080 \
  -e OPENAI_API_BASE_URL=http://host.containers.internal:12218/v1 \
  -e OPENAI_API_KEY=not-needed \
  ghcr.io/open-webui/open-webui:main

Open http://localhost:3001, create an account, then go to Admin Settings > Connections and disable the Ollama API (so all traffic routes through Aleutian). Models appear automatically.

Continue.dev (VS Code / JetBrains):

In ~/.continue/config.json:

{
  "models": [{
    "title": "Aleutian",
    "provider": "openai",
    "model": "gemma3n",
    "apiBase": "http://localhost:12218/v1",
    "apiKey": "not-needed"
  }]
}

Aider:

aider --openai-api-base http://localhost:12218/v1 --openai-api-key not-needed

Any OpenAI SDK:

from openai import OpenAI
client = OpenAI(base_url="http://localhost:12218/v1", api_key="not-needed")
response = client.chat.completions.create(
    model="gemma3n",
    messages=[{"role": "user", "content": "Find dead code in this project"}]
)
print(response.choices[0].message.content)

MCP Server (Claude Code / Cursor / Windsurf)

For AI coding assistants that support MCP, a dedicated trace-mcp binary exposes all trace tools over the Model Context Protocol:

go build -o trace-mcp ./cmd/trace-mcp

Add to .claude/mcp.json in your project root:

{
  "mcpServers": {
    "aleutian-trace": {
      "command": "trace-mcp",
      "args": ["-trace-url", "http://localhost:12217"]
    }
  }
}

See services/trace/README.md for the full MCP tool list and configuration details.

Architecture

┌─────────────────────────────────────────────────────────┐
│  Clients: Open WebUI, Continue, Aider, curl, MCP        │
└──────────────────────┬──────────────────────────────────┘
                       │ OpenAI API / MCP
              ┌────────▼────────┐
              │  Trace Proxy    │ :12218  ← OpenAI-compatible gateway
              │  (trace-proxy)  │
              └────────┬────────┘
                       │ HTTP
              ┌────────▼────────┐
              │  Trace Server   │ :12217  ← Agent loop, CRS, 24+ tools
              │  (trace)        │
              └──┬─────┬────┬───┘
                 │     │    │
        ┌────────▼┐ ┌──▼──┐ ┌▼──────────┐
        │Weaviate │ │NATS │ │Orchestrator│
        │(vectors)│ │(CRS)│ │(embeddings)│
        │  :12212 │ │:4222│ │   :12210   │
        └─────────┘ └─────┘ └──────┬─────┘
                                   │
                            ┌──────▼──────┐
                            │  RAG Engine  │
                            │  (Python)    │
                            │    :12211    │
                            └─────────────┘
                                   │
                            ┌──────▼──────┐
                            │   Ollama     │  ← Runs on host
                            │  (LLM +     │
                            │  embeddings) │
                            │   :11434     │
                            └─────────────┘
Services
Service Port Description
Trace Proxy 12218 OpenAI-compatible API gateway
Trace Server 12217 Code graph, agent loop, 24+ tools
Orchestrator 12210 Embedding coordination, document processing
RAG Engine 12211 Python retrieval and generation pipelines
Weaviate 12212 Vector database for symbol embeddings
NATS 4222 CRS delta streaming and state persistence
Jaeger 12214 Distributed tracing UI
Ollama 11434 Local LLM inference (runs on host)
Agent Tools

The trace agent has access to 24+ tools organized by category:

Graph Queries — find_callers, find_callees, find_implementations, find_symbol, get_call_chain, find_references

Semantic Search — semantic_search (vector similarity over indexed symbols), find_similar_symbols

Analytics — hotspots (most-connected nodes), cycles (Tarjan's SCC), important (PageRank), communities (Leiden algorithm), dead_code, shortest_path

Exploration — entry_points, data_flow, error_flow, config_usage, similar_code, minimal_context, summarize_file, summarize_package, change_impact

Reasoning — breaking_changes, simulate_change, validate_change, test_coverage, side_effects, suggest_refactor

Observability

All services export OpenTelemetry traces. View them in Jaeger at http://localhost:12214.

Analyze trace performance from the command line:

# List recent traces
./scripts/trace_breakdown.sh --list

# Analyze a specific trace
./scripts/trace_breakdown.sh <trace_id>

CLI Commands

Command Description
aleutian stack start Start all services
aleutian stack start --build Rebuild images and start
aleutian stack stop Stop all services
aleutian stack status Show health and resource usage
aleutian stack logs [service] Stream container logs
aleutian stack destroy Remove all containers and data
aleutian health Check service health

System Requirements

  • macOS: Apple Silicon M1+ recommended (Metal acceleration for Ollama)
  • Linux: Modern kernel for Podman; NVIDIA GPU optional but beneficial
  • RAM: 16GB minimum (12B models), 32GB+ recommended (20B+ models)
  • Disk: 20GB+ free space (excluding model weights)

Performance scales with memory bandwidth. LLM inference dominates response time:

  • M4 Max (~546 GB/s): ~15-20s per query
  • RTX 5090 (~1.8 TB/s): ~5-10s per query

License

This project is licensed under the GNU Affero General Public License v3.0 — see LICENSE.txt for details.

Additional terms in NOTICE.txt regarding AI system attribution under AGPLv3 Section 7.

Documentation

Overview

Copyright (C) 2025 Aleutian AI (jinterlante@aleutian.ai) This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. See the LICENSE.txt file for the full license text.

NOTE: This work is subject to additional terms under AGPL v3 Section 7. See the NOTICE.txt file for details regarding AI system attribution.

Directories

Path Synopsis
cmd
aleutian command
Package main provides CachePathResolver for optimal cache location resolution.
Package main provides CachePathResolver for optimal cache location resolution.
aleutian/config
Package config provides configuration types and loading for the Aleutian CLI.
Package config provides configuration types and loading for the Aleutian CLI.
aleutian/internal/diagnostics
Package diagnostics provides DefaultDiagnosticsCollector for gathering system diagnostics.
Package diagnostics provides DefaultDiagnosticsCollector for gathering system diagnostics.
aleutian/internal/graph
Package graph provides graph traversal algorithms for code analysis.
Package graph provides graph traversal algorithms for code analysis.
aleutian/internal/health
Package health deps.go contains temporary interface definitions for dependencies not yet moved to their target packages.
Package health deps.go contains temporary interface definitions for dependencies not yet moved to their target packages.
aleutian/internal/impact
Package impact provides change impact analysis for code changes.
Package impact provides change impact analysis for code changes.
aleutian/internal/infra
Package infra provides InfrastructureManager for Podman machine lifecycle management.
Package infra provides InfrastructureManager for Podman machine lifecycle management.
aleutian/internal/infra/process
Package process provides abstractions for external process execution and inter-process synchronization.
Package process provides abstractions for external process execution and inter-process synchronization.
aleutian/internal/initializer
Package initializer provides local initialization for Aleutian Trace.
Package initializer provides local initialization for Aleutian Trace.
aleutian/internal/models
Package models provides model management capabilities for the Aleutian CLI.
Package models provides model management capabilities for the Aleutian CLI.
aleutian/internal/resilience
Package resilience provides recovery and rollback patterns.
Package resilience provides recovery and rollback patterns.
aleutian/internal/risk
Package risk provides aggregated risk assessment for code changes.
Package risk provides aggregated risk assessment for code changes.
aleutian/internal/sampling
Package sampling provides load-adaptive sampling utilities.
Package sampling provides load-adaptive sampling utilities.
aleutian/internal/util
Package util provides foundational utilities for the Aleutian CLI.
Package util provides foundational utilities for the Aleutian CLI.
orchestrator command
Command orchestrator starts the AleutianLocal orchestrator HTTP server.
Command orchestrator starts the AleutianLocal orchestrator HTTP server.
routing_cache_dump command
routing_cache_dump inspects the Trace agent's routing embedding cache.
routing_cache_dump inspects the Trace agent's routing embedding cache.
trace command
Command trace starts the Aleutian Trace API server.
Command trace starts the Aleutian Trace API server.
trace-mcp command
Package main implements the Aleutian Trace MCP server.
Package main implements the Aleutian Trace MCP server.
trace-proxy command
Package main implements the Aleutian Trace OpenAI-compatible proxy.
Package main implements the Aleutian Trace OpenAI-compatible proxy.
pkg
extensions
Package extensions defines interfaces for enterprise functionality.
Package extensions defines interfaces for enterprise functionality.
logging
Package logging provides structured logging for Aleutian components.
Package logging provides structured logging for Aleutian components.
ux
Package ux provides user experience components for the Aleutian CLI.
Package ux provides user experience components for the Aleutian CLI.
validation
Package validation provides input validation utilities for security-critical operations.
Package validation provides input validation utilities for security-critical operations.
generate_tool_docs generates a comprehensive markdown reference table from tool_registry.yaml.
generate_tool_docs generates a comprehensive markdown reference table from tool_registry.yaml.
services
data_fetcher command
llm
Package llm provides interfaces and implementations for LLM backends.
Package llm provides interfaces and implementations for LLM backends.
orchestrator
Package orchestrator provides the core orchestrator service for AleutianLocal.
Package orchestrator provides the core orchestrator service for AleutianLocal.
orchestrator/conversation
Package conversation provides semantic memory capabilities for conversation history.
Package conversation provides semantic memory capabilities for conversation history.
orchestrator/handlers
Package handlers provides HTTP handlers for the orchestrator service.
Package handlers provides HTTP handlers for the orchestrator service.
orchestrator/middleware
Package middleware provides HTTP middleware for the orchestrator service.
Package middleware provides HTTP middleware for the orchestrator service.
orchestrator/observability
Package observability provides metrics and instrumentation for the orchestrator.
Package observability provides metrics and instrumentation for the orchestrator.
orchestrator/services
Package services provides business logic services for the orchestrator.
Package services provides business logic services for the orchestrator.
orchestrator/ttl
Package ttl provides time-to-live (TTL) management for documents and sessions in the Aleutian RAG system.
Package ttl provides time-to-live (TTL) management for documents and sessions in the Aleutian RAG system.
trace
Package trace provides the Trace HTTP service for code analysis.
Package trace provides the Trace HTTP service for code analysis.
trace/agent
Package agent provides a state-machine-driven agent orchestration system.
Package agent provides a state-machine-driven agent orchestration system.
trace/agent/classifier
Package classifier provides query classification for tool forcing decisions.
Package classifier provides query classification for tool forcing decisions.
trace/agent/context
Package context provides context management for the agent loop.
Package context provides context management for the agent loop.
trace/agent/control
Package control provides control flow hardening for the agent loop.
Package control provides control flow hardening for the agent loop.
trace/agent/events
Package events provides event types and handling for the agent loop.
Package events provides event types and handling for the agent loop.
trace/agent/grounding
Package grounding provides anti-hallucination validation for LLM responses.
Package grounding provides anti-hallucination validation for LLM responses.
trace/agent/llm
Package llm provides the LLM client interface for the agent loop.
Package llm provides the LLM client interface for the agent loop.
trace/agent/mcts
Package mcts implements Monte Carlo Tree Search-inspired plan tree reasoning.
Package mcts implements Monte Carlo Tree Search-inspired plan tree reasoning.
trace/agent/mcts/algorithms
Package algorithms provides pure function implementations for the MCTS system.
Package algorithms provides pure function implementations for the MCTS system.
trace/agent/mcts/crs
Package crs provides the Code Reasoning State (CRS) - the central mutable state container for the Aleutian Hybrid MCTS system.
Package crs provides the Code Reasoning State (CRS) - the central mutable state container for the Aleutian Hybrid MCTS system.
trace/agent/mcts/crs/indexes
Package indexes provides the 6 index implementations for CRS.
Package indexes provides the 6 index implementations for CRS.
trace/agent/phases
Package phases implements the agent state machine phases.
Package phases implements the agent state machine phases.
trace/agent/providers
Package providers defines provider-agnostic interfaces and factories for LLM backends used by the Trace agent.
Package providers defines provider-agnostic interfaces and factories for LLM backends used by the Trace agent.
trace/agent/providers/egress
Package egress provides data egress control, audit trail, and compliance enforcement for LLM provider calls.
Package egress provides data egress control, audit trail, and compliance enforcement for LLM provider calls.
trace/agent/routing
Package routing provides tool selection using a fast micro LLM.
Package routing provides tool selection using a fast micro LLM.
trace/agent/safety
Package safety provides safety gate functionality for the agent loop.
Package safety provides safety gate functionality for the agent loop.
trace/analysis
Package analysis provides code analysis tools for Trace.
Package analysis provides code analysis tools for Trace.
trace/ast
Package ast provides types and interfaces for language-agnostic AST parsing.
Package ast provides types and interfaces for language-agnostic AST parsing.
trace/bridge
Package bridge provides a reusable HTTP client wrapping all trace tool endpoints.
Package bridge provides a reusable HTTP client wrapping all trace tool endpoints.
trace/cache
Package cache provides ephemeral graph caching with LRU eviction.
Package cache provides ephemeral graph caching with LRU eviction.
trace/cancel
Package cancel provides hierarchical cancellation for the CRS algorithm system.
Package cancel provides hierarchical cancellation for the CRS algorithm system.
trace/cli/tools
Package tools provides CLI tools for graph queries.
Package tools provides CLI tools for graph queries.
trace/cli/tools/file
Package file provides file operation tools for the Aleutian Trace CLI.
Package file provides file operation tools for the Aleutian Trace CLI.
trace/cli/tools/validate
Package validate provides validation tools for the CB-56 Multi-Step Change Execution Framework.
Package validate provides validation tools for the CB-56 Multi-Step Change Execution Framework.
trace/config
Package config provides configuration loading for the trace service.
Package config provides configuration loading for the trace service.
trace/context
Package context provides the Context Assembler for Trace.
Package context provides the Context Assembler for Trace.
trace/coordinate
Package coordinate provides multi-file change coordination for Trace.
Package coordinate provides multi-file change coordination for Trace.
trace/dag
Package dag provides a DAG-based execution framework for Trace pipelines.
Package dag provides a DAG-based execution framework for Trace pipelines.
trace/dag/nodes
Package nodes provides concrete DAG node implementations for Trace pipelines.
Package nodes provides concrete DAG node implementations for Trace pipelines.
trace/diff
Package diff provides diff parsing, rendering, and application for code review.
Package diff provides diff parsing, rendering, and application for code review.
trace/eval
Package eval provides the evaluation framework for Trace components.
Package eval provides the evaluation framework for Trace components.
trace/eval/ab
Package ab provides A/B testing harness for comparing algorithm implementations.
Package ab provides A/B testing harness for comparing algorithm implementations.
trace/eval/benchmark
Package benchmark provides performance benchmarking for evaluable components.
Package benchmark provides performance benchmarking for evaluable components.
trace/eval/chaos
Package chaos provides fault injection for resilience testing.
Package chaos provides fault injection for resilience testing.
trace/eval/regression
Package regression provides CI/CD regression detection gates.
Package regression provides CI/CD regression detection gates.
trace/eval/telemetry
Package telemetry provides observability infrastructure for the evaluation framework.
Package telemetry provides observability infrastructure for the evaluation framework.
trace/explore
Package explore provides high-level exploration tools for code analysis.
Package explore provides high-level exploration tools for code analysis.
trace/git
Package git provides git-aware cache invalidation for Trace.
Package git provides git-aware cache invalidation for Trace.
trace/graph
Package graph provides code relationship graph types and operations.
Package graph provides code relationship graph types and operations.
trace/impact
Package impact provides unified change impact analysis for Trace.
Package impact provides unified change impact analysis for Trace.
trace/index
Package index provides in-memory indexing for code symbols.
Package index provides in-memory indexing for code symbols.
trace/lint
Package lint provides integration with external linters for code validation.
Package lint provides integration with external linters for code validation.
trace/lock
Package lock provides file locking capabilities for safe concurrent file operations.
Package lock provides file locking capabilities for safe concurrent file operations.
trace/lsp
Package lsp provides Language Server Protocol integration for Trace.
Package lsp provides Language Server Protocol integration for Trace.
trace/manifest
Package manifest provides file manifest and hash tracking for cache invalidation.
Package manifest provides file manifest and hash tracking for cache invalidation.
trace/patterns
Package patterns provides design pattern and anti-pattern detection for Trace.
Package patterns provides design pattern and anti-pattern detection for Trace.
trace/rag
Package rag provides graph-backed entity resolution for parameter extraction.
Package rag provides graph-backed entity resolution for parameter extraction.
trace/reason
Package reason provides tools for reasoning about code changes.
Package reason provides tools for reasoning about code changes.
trace/safety
Package safety provides security analysis tools for Trace.
Package safety provides security analysis tools for Trace.
trace/safety/trust
Package trust provides trust boundary analysis for security scanning.
Package trust provides trust boundary analysis for security scanning.
trace/safety/trust_flow
Package trust_flow provides trust flow analysis for security scanning.
Package trust_flow provides trust flow analysis for security scanning.
trace/seeder
Package seeder provides library documentation seeding for Trace.
Package seeder provides library documentation seeding for Trace.
trace/storage/badger
Package badger provides factory functions and configuration for BadgerDB.
Package badger provides factory functions and configuration for BadgerDB.
trace/storage/nats
Package nats provides a NATS JetStream client wrapper for CRS state persistence.
Package nats provides a NATS JetStream client wrapper for CRS state persistence.
trace/tdg
Package tdg provides Test-Driven Generation (TDG) for Trace.
Package tdg provides Test-Driven Generation (TDG) for Trace.
trace/telemetry
Package telemetry provides OpenTelemetry-based observability for Trace.
Package telemetry provides OpenTelemetry-based observability for Trace.
trace/transaction
Package transaction provides atomic file operations with git-based rollback.
Package transaction provides atomic file operations with git-based rollback.
trace/tui
Package tui provides terminal user interface components for interactive review.
Package tui provides terminal user interface components for interactive review.
trace/validation
Package validation provides input validation for untrusted data.
Package validation provides input validation for untrusted data.
trace/verify
Package verify provides hash-verified operations for code graphs.
Package verify provides hash-verified operations for code graphs.
trace/weaviate
Package weaviate provides a resilient Weaviate client with circuit breaker, retry with backoff, and graceful degradation.
Package weaviate provides a resilient Weaviate client with circuit breaker, retry with backoff, and graceful degradation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL