{"id":51193041,"url":"https://github.com/angelnicolasc/meridian","last_synced_at":"2026-06-27T17:30:52.568Z","repository":{"id":359221401,"uuid":"1244989450","full_name":"angelnicolasc/meridian","owner":"angelnicolasc","description":"Phase-aware vLLM scheduler for reasoning models: output-first dispatch, entropy-gated think termination, tiered KV eviction, and TTOT-focused benchmarking.","archived":false,"fork":false,"pushed_at":"2026-05-20T23:05:26.000Z","size":609,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-21T04:32:53.006Z","etag":null,"topics":["cuda","inference","kv-cache","llm","observability","pyo3","python","reasoning-models","rust","scheduler","vllm"],"latest_commit_sha":null,"homepage":"https://angelnicolasc.github.io/meridian/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/angelnicolasc.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-20T19:55:22.000Z","updated_at":"2026-05-21T00:01:38.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/angelnicolasc/meridian","commit_stats":null,"previous_names":["angelnicolasc/meridian"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/angelnicolasc/meridian","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angelnicolasc%2Fmeridian","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angelnicolasc%2Fmeridian/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angelnicolasc%2Fmeridian/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angelnicolasc%2Fmeridian/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/angelnicolasc","download_url":"https://codeload.github.com/angelnicolasc/meridian/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angelnicolasc%2Fmeridian/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34862627,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-27T02:00:06.362Z","response_time":126,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cuda","inference","kv-cache","llm","observability","pyo3","python","reasoning-models","rust","scheduler","vllm"],"created_at":"2026-06-27T17:30:51.837Z","updated_at":"2026-06-27T17:30:52.561Z","avatar_url":"https://github.com/angelnicolasc.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Meridian\n\n**Inference-time compute scheduler for reasoning models.**\n\n[![CI](https://github.com/angelnicolasc/meridian/actions/workflows/ci.yml/badge.svg)](https://github.com/angelnicolasc/meridian/actions/workflows/ci.yml)\n[![Docs](https://github.com/angelnicolasc/meridian/actions/workflows/docs.yml/badge.svg)](https://angelnicolasc.github.io/meridian)\n[![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)\n[![Rust 1.85+](https://img.shields.io/badge/rust-1.85+-orange.svg)](rust-toolchain.toml)\n[![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](python/pyproject.toml)\n[![CUDA 12.6](https://img.shields.io/badge/CUDA-12.6-76b900.svg)](.devcontainer/Dockerfile)\n[![Release](https://img.shields.io/github/v/release/angelnicolasc/meridian?sort=semver\u0026display_name=tag)](https://github.com/angelnicolasc/meridian/releases)\n[![SLSA Level 2](https://img.shields.io/badge/SLSA-Level_2-success.svg)](https://github.com/angelnicolasc/meridian/releases)\n\n---\n\n## What Meridian is\n\nMeridian is a scheduling layer for vLLM that treats the two token-generation\nphases of reasoning models as distinct workloads. It intercepts the vLLM\nscheduler at runtime — no fork required — and applies separate SLOs,\neviction policies, and entropy-driven budget control to each phase.\n\n## What problem it solves\n\nReasoning models (DeepSeek-R1, Qwen3, o3, Granite 3.2) emit two structurally\ndifferent sequences in a single request:\n\n```\n[prompt] → \u003cthink\u003e ... N reasoning tokens ... \u003c/think\u003e → [output tokens]\n```\n\n| Phase         | User-visible? | Latency tolerance | Cost profile |\n|---------------|--------------|-------------------|--------------|\n| Think-decode  | No           | High              | Throughput-bound |\n| Output-decode | Yes          | Zero tolerance    | Latency-bound |\n\nStandard continuous-batching schedulers process both phases from the same\npriority queue with the same inter-token latency target. This leaves\noutput-phase latency unnecessarily constrained by think-phase batch dynamics.\nMeridian exploits the asymmetry.\n\n## What is verified today\n\n| Component | Verified in CI | Verified on GPU runner |\n|-----------|:--------------:|:----------------------:|\n| `PhaseRouter` state machine | ✓ | — |\n| `MeridianScheduler` dual-queue dispatch | ✓ | — |\n| `PhaseAwareBlockManager` three-tier eviction | ✓ | — |\n| `EntropyProbe` CPU backend (NumPy) | ✓ | — |\n| `meridian-kernels` CUDA kernels — EAT/entropy correctness vs CPU | — | ✓ |\n| vLLM plugin — attach / reorder / inject | ✓ | ✓ |\n| Disagg block manager surface (`offload_block`, `ingest_block`) | ✓ | — |\n| NIXL fabric wire protocol (synthetic mock) | ✓ | — |\n| Benchmark harness — synthetic replay | ✓ | ✓ |\n| Benchmark harness — real-vLLM with `Qwen2.5-0.5B` | — | — |\n| SLSA L2 provenance attestation | ✓ (on every `v*` tag) | — |\n| `cargo deny` supply-chain audit | ✓ | — |\n\n---\n\n## What Meridian implements\n\n```\nIncoming requests\n      │\n      ▼\n Phase Router  ──── token stream state machine, O(1) per token\n      │\n      ├── ExitThink / ForceBudget ─▶  EAT + RPDI entropy signals\n      │\n      ├── Think-Decode Scheduler  (TPOT-relaxed, 2.5× batch budget)\n      │\n      └── Output-Decode Scheduler (TTOT-strict, stream priority)\n              │\n              ▼\n    Phase-Aware KV Block Manager\n      ThinkComplete ← evicted first\n      ThinkActive\n      OutputCritical ← never evicted without alerting\n```\n\n1. **Dual-queue scheduling** — output-phase requests drain the GPU batch\n   before think-phase requests fill remaining capacity. Backed by\n   [`crates/meridian-core/src/scheduler.rs`](crates/meridian-core/src/scheduler.rs).\n\n2. **Phase-aware KV eviction** — three tiers with strict priority ordering.\n   `OutputCritical` eviction fires an observable counter; the target rate is zero.\n   Backed by [`crates/meridian-core/src/block_manager.rs`](crates/meridian-core/src/block_manager.rs).\n\n3. **Entropy-driven budget forcing** — EAT ([arXiv:2509.26522](https://arxiv.org/abs/2509.26522))\n   and RPDI ([arXiv:2603.14251](https://arxiv.org/abs/2603.14251)) signals inject\n   `\u003c/think\u003e` when the model signals convergence, not on a static timer. CUDA\n   kernels run on a dedicated secondary stream. Backed by\n   [`crates/meridian-kernels/`](crates/meridian-kernels/) and\n   [`python/meridian/entropy_probe.py`](python/meridian/entropy_probe.py).\n\n4. **Drop-in vLLM plugin** — wraps the existing scheduler via attribute\n   delegation; fully reversible; no vLLM source modification.\n   Backed by [`python/meridian/vllm_plugin.py`](python/meridian/vllm_plugin.py).\n\n5. **Disagg KV transfer** — `offload_block` / `ingest_block` hooks support\n   prefill-decode disaggregation fabrics (NIXL, Mooncake-compatible).\n   Documented in [ADR-0006](docs/src/adr/0006-disagg-kv-transfer.md).\n\n---\n\n## Quickstart\n\nRequires Linux (or WSL2), Rust 1.85+, Python 3.11+. GPU + CUDA 12.6 for the\nCUDA backend; not required for synthetic benchmarks or unit tests.\n\n```bash\ngit clone https://github.com/angelnicolasc/meridian.git\ncd meridian\n\n# Install Python deps and build the native extension.\nuv sync --project python\nmaturin develop --release -m crates/meridian-python/Cargo.toml\n\n# Run all tests (no GPU required).\ncargo nextest run --workspace\nuv run --project python pytest -m \"not gpu and not vllm\"\n\n# Run the synthetic A/B benchmark (no GPU, no vLLM).\nuv --project python run python -m benchmarks.meridian_bench synthetic-replay \\\n    --baseline stock --duration-s 30 --arrival-rate 8 --out-dir bench-out/\n```\n\nFor CUDA kernel support, append `--cargo-extra-args=\"--features cuda\"` to the\n`maturin develop` call (requires `nvcc` + CUDA 12.6).\n\n---\n\n## Repository layout\n\n```\ncrates/meridian-core/    Rust scheduler core — no CUDA, no Python dep\ncrates/meridian-kernels/ CUDA entropy and EAT kernels + C FFI + NIXL wrappers\ncrates/meridian-python/  pyo3 bindings (built via maturin)\npython/meridian/         Python package — EntropyProbe, vLLM plugin, config\ndocs/                    mdBook documentation + 7 ADRs\nmodels/                  Per-model token boundary configs (DeepSeek-R1, Qwen3, ...)\nbenchmarks/              Replay harness — synthetic + real-vLLM + A/B mode\n```\n\n---\n\n## Non-goals\n\nMeridian is not a throughput optimiser, accuracy guarantor, or full serving\nengine. See [Non-goals](docs/src/non-goals.md) for explicit scope boundaries.\n\n---\n\n## Evidence\n\n| Artifact | Link |\n|----------|------|\n| CI results | [GitHub Actions](https://github.com/angelnicolasc/meridian/actions) |\n| Release provenance (SLSA L2) | [Releases](https://github.com/angelnicolasc/meridian/releases) |\n| Supply-chain audit | `cargo deny check` in [ci.yml](.github/workflows/ci.yml) |\n| Architecture \u0026 ADRs | [docs/src/](docs/src/) |\n| Benchmark methodology | [ADR-0005](docs/src/adr/0005-benchmark-methodology.md) |\n\n---\n\n## Contributing\n\nContributions welcome under [DCO sign-off](CONTRIBUTING.md). Read\n[CONTRIBUTING.md](CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md)\nbefore opening a PR. Security disclosures: [SECURITY.md](SECURITY.md).\n\n## License\n\nApache License 2.0 — see [LICENSE](LICENSE) and [NOTICE](NOTICE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangelnicolasc%2Fmeridian","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fangelnicolasc%2Fmeridian","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangelnicolasc%2Fmeridian/lists"}