AgentMesh Gateway
AgentMesh Gateway social preview by Faramarz Kowsari
Open research software · AI infrastructure · v0.3.0

One gateway. Many AI protocols and providers.

AgentMesh Gateway gives AI clients and coding agents a stable entry point, then decides which configured provider is actually eligible before any routing policy is allowed to optimize for latency, cost, quality or order.

OpenAI-shaped APIsAnthropic-shaped APIsResponses-compatible pathFailoverDeterministic simulationAdaptive routing research

Project story: how AgentMesh reached v0.3.0

A plain-language timeline of why the project was started, what changed at each stage, why the current boundary exists, and where the architecture can grow next.

WHY THIS PROJECT EXISTS

One stable gateway, without pretending every AI provider is interchangeable.

AgentMesh began on 22 August 2026 as an independent implementation built around a practical problem: coding agents and AI clients increasingly need several local and remote model providers, but those providers differ in protocol, tools, reasoning semantics, price, latency, reliability and quotas. A simple “pick the cheapest model” router can therefore make the wrong decision before optimization even begins. The project was designed around a stricter rule: first determine which providers can preserve the request safely and meaningfully; only then optimize among the feasible choices.

Start

Independent foundation

The repository was bootstrapped as an original Apache-2.0 project with explicit provenance rules, a protocol-neutral domain model, FastAPI ingress, environment-driven provider configuration and tests that require no paid API key.

Why this came first: without a neutral core, every future provider would leak vendor-specific assumptions into routing and make research comparisons unreliable.

v0.1

Gateway mechanics became real

OpenAI-shaped Chat Completions, a partial Responses surface and Anthropic-shaped Messages were connected to generic provider adapters. Ordered, latency, cost, quality and balanced routing, fallback, retry normalization, circuit breaking, optional bearer authentication and CI across Python 3.11–3.13 formed the first working product boundary.

Why the project moved on: a gateway that only forwards text is useful, but coding agents also depend on streaming, function calls and protocol-specific semantics.

v0.2

Compatibility was hardened instead of overclaimed

The Responses lifecycle was expanded, custom function-call loops and streaming tool deltas were normalized, a Codex contract harness was added, native Responses reasoning and recognised built-in tools could be preserved, and unsupported semantics began returning explicit 4xx errors rather than being silently dropped.

Why this mattered: “looks compatible” is dangerous if reasoning controls or tool semantics disappear during translation. v0.2 made semantic preservation an explicit routing constraint.

v0.3

The gateway became a research substrate

Capability-aware feasibility, observed token/cost accounting, EWMA plus bounded p50/p95 latency evidence, deterministic local quota windows, a no-network policy simulator, provenance-checked quality profiles and simulation-only adaptive_balanced and constrained_ucb baselines were added. The release was archived on Zenodo and documented through GitHub Pages.

Why the architecture changed here: the project was no longer only asking “which provider should serve this request?” It could now study that decision reproducibly under cost, latency, capability, failure and quota constraints.

WHERE IT IS NOW

A tested gateway + reproducible routing laboratory

Today the project offers three client-facing protocol families, three upstream adapter families, feasibility-first production routing, bounded fallback, runtime evidence, local quota controls, offline simulation, architectural decision records, CI, Docker, DOI-backed release metadata and a three-language documentation site.

WHY IT STOPS HERE FOR NOW

The remaining boundaries are intentional

v0.3.0 does not claim full OpenAI Responses compatibility, does not silently translate semantics it cannot preserve, and does not enable adaptive policies in live production routing. Vision, audio and other multimodal dimensions are also deferred until the normalized request model can represent them without loss. These are safety and research-integrity boundaries, not unfinished marketing claims.

WHAT A RESEARCHER GETS

A controlled experimental surface

A researcher can replay identical traces across static and adaptive policies, inspect feasible provider sets, measure observed latency/cost evidence, model local quota pressure, attach benchmark provenance to quality profiles, export JSON/CSV results and extend routing logic without paying for live provider calls during deterministic experiments.

Growth capacity: what can be added next?

The current architecture deliberately leaves several high-value research and engineering directions open.

Multimodal feasibility

Add vision, audio, context-window, structured-output and other capability dimensions after the neutral request model can represent them losslessly.

Persistent control plane

Add PostgreSQL/SQLite state, encrypted secret storage, provider validation, audit history and a dashboard for operational use.

Production observability

Add Prometheus/OpenTelemetry exporters, SLOs, long-horizon reliability statistics and richer cost/latency dashboards.

More agent contracts

Expand dedicated fixtures for Claude Code, Cline, OpenCode and additional Codex behaviours without weakening semantic gates.

Real benchmark evidence

Publish frozen coding/agent benchmark procedures, provider traces and quality profiles with explicit provenance so adaptive routing can be evaluated scientifically.

Guarded production adaptation

Move adaptive policies from simulator to live routing only after benchmark evidence, safety constraints, rollback rules and separate architecture review.

Read the complete technical guideOpen the roadmapCite v0.3.0

What makes AgentMesh different?

Instead of ranking every provider and hoping for the best, AgentMesh first removes choices that would violate the request's model, protocol, capability, circuit or local quota constraints.

Feasibility first

Hard gates

Incompatible providers cannot win simply because they are cheaper or faster.

Evidence-aware runtime

Cost + latency

Observed token usage, cost evidence, EWMA latency and bounded p50/p95 samples are tracked without inventing missing measurements.

Research without live cost

No-network

Static and adaptive policies can be replayed against deterministic traces without contacting real provider endpoints.

The request journey

The core architecture separates protocol translation, feasibility, policy ranking, provider execution and research instrumentation.

1

Client request

Chat, Responses-style or Anthropic-shaped traffic arrives.

2

Normalize

Messages, tools and response semantics enter a protocol-neutral model where possible.

3

Filter

Model, circuit, protocol-losslessness, capability and quota gates remove invalid choices.

4

Rank

A production policy ranks only the feasible provider set.

5

Execute

The provider adapter handles the upstream call, errors, retry and failover boundaries.

6

Observe

Runtime evidence can feed diagnostics and offline simulation without silently changing policy behavior.

For researchers: the project is not only a gateway. It is also a controlled experimental substrate for studying routing under cost, latency, capability, reliability and quota constraints. v0.3.0 includes simulation-only adaptive_balanced and constrained_ucb baselines, with explicit boundaries between production routing and research experiments.

About the author

Author profile and official links.

Faramarz Kowsari

Faramarz Kowsari

Faramarz Kowsari is an author, researcher based in Istanbul. Focusing on the intersection of technology, education, and personal growth, he has published over 80 digital titles on international platforms. His areas of expertise span Artificial Intelligence, prompt engineering, modern trading strategies (Smart Money Concepts & algorithmic trading), as well as classical literature and mindfulness. In addition to writing, he develops web-based educational tools and creates specialized instructional video content.

Official Profiles & Repositories

Research and archival record

Versioned software, reproducibility documentation and permanent citation metadata.

Version

0.3.0

Python 3.11+ with CI on Python 3.11, 3.12 and 3.13.

License

Apache-2.0

Open development with explicit provenance and contribution guidance.