Open Source AI Compiler

Compile Smarter.
Optimize Every AI Workflow.

An AI compiler pipeline for multi-agent systems. Parse YAML workflows, run 10 optimization passes, and generate measurable before/after reports — all without API keys, internet, or configuration.

170+
Tests Passed
10
Compiler Passes
7
LLM Providers
21
CLI Commands

Watch the Compiler in Action

An interactive walkthrough of the optimization pipeline — auto-looping.

workflow: name: Customer Support Agent entry: classify nodes: - id: classify type: agent model: claude-sonnet-4-6 - id: search_kb type: tool tools: [kb_search] - id: lookup_order type: tool - id: draft_response type: agent model: claude-haiku-4-5 edges: - classify -> search_kb - search_kb -> lookup_order - lookup_order -> draft_response
Detected
4 nodes (2 agents, 2 tools)
3 sequential tool calls
Claude Sonnet + Haiku mix
Estimated Before
LATENCY
2.9s
COST
$0.84
TOKENS
18,450

Compiler Pipeline

Parse
Build IR
Analyze
Transform
Validate
Generate

Each stage executes deterministically — no external API calls

Optimization Passes Applied

Dead Node Elimination
Prompt Compression
Token Optimization
Parallel Execution
Cost Analysis
Model Selection
Cache Detection
Workflow Validation

Before vs After

Before Optimization

Latency2.9s
Cost$0.84
Tokens18,450

After Optimization

Latency1.4s -52%
Cost$0.42 -50%
Tokens9,100 -51%

Everything You Need to Optimize AI Workflows

A complete toolkit: compiler, runtime, benchmark engine, and model intelligence.

Compiler Architecture

LLVM-style pipeline: Parse → IR → Analysis → Transform → Generate. 10 optimization passes.

Optimization Passes

Dead node elimination, parallel execution, prompt compression, context pruning, cache detection.

Beautiful CLI

21 commands with Rich formatting, progress bars, cinematic output. Zero configuration, offline-first.

Benchmarking Engine

Directory-level benchmarking. HTML reports, certificates, leaderboards, Mermaid diagrams.

Execution Runtime

Provider-agnostic execution. Real LLM mode or simulated. Swap providers like Git remotes.

Multi-Provider Support

OpenAI, Anthropic, Gemini, OpenRouter, Ollama, LM Studio, Azure. One interface, 7 providers.

Model Intelligence

19-model registry with capability-based auto-selection. Matches workflow to optimal model.

Simulation-First

Full pipeline runs without API keys. Realistic latency, token, and cost models. Offline by default.

Compiler Architecture

LLVM-inspired pipeline: parse, analyze, transform, and generate.

📄

YAML Workflow

Source definition with agents, tools, edges

Parser → IR

Build intermediate representation graph
🔍

Analysis Passes (6)

Dead node, sequential tools, large context, high cost

Transform Passes (4)

Eliminate, parallelize, compress, prune
📊

HTML Reports

Certificates, leaderboards, Mermaid diagrams
Beautiful CLI

One Command. Everything Generated.

Terminal
$uv run lynk demo
4 workflows analyzed. Report generated.
$uv run lynk benchmark run examples/
15 workflows benchmarked. Leaderboard updated.
$uv run lynk demo

Provider Abstraction

Swap LLM providers like Git remotes. One interface, 7 backends.

OpenAI
Anthropic
Gemini
OpenRouter
Ollama
Azure
LM Studio

Built for Production

0
Tests Passed
0
Compiler Passes
0
Models Registered
0
LLM Providers

Open Source

Apache 2.0 licensed. 170 tests. Built in the open. Contributions welcome.

Star on GitHub View Repository