Two Protocols, One Backend — Anthropic and OpenAI with Codable

Swift on the Server with Hummingbird

A series on server-side Swift with the Hummingbird framework — from the first route to a deployable LLM gateway on Linux.

We are building an OpenAI-compatible LLM gateway in Swift with the Hummingbird framework. The gateway runs against a local MLX model on Apple Silicon and deploys as a fully statically linked binary on Linux — with streaming, API-key auth, rate limiting, Prometheus metrics, and distributed tracing. The demo project is swift-mlx-gateway on Codeberg, with a Git tag per article to follow along. Six articles plus the prologue.

  1. 0

    Swift on the Server — Hummingbird 2 and a Local LLM Gateway

    Prologue · Series: Swift on the Server with Hummingbird. Why Swift on the server is no longer a hobby project in 2026, how Hummingbird differs from Vapor and why we chose a local LLM gateway as our demo project.
    13. May 2026
  2. 1

    Hello Hummingbird — The Skeleton

    Article 1 · Swift on the Server with Hummingbird. We create the project, write Package.swift, set up the AsyncParsableCommand entry point, and build a minimal router with /healthz and /v1/models until curl gets an answer.
    14. May 2026
  3. 2

    Two Protocols, One Backend — Anthropic and OpenAI with Codable

    Article 2 of the Hummingbird series. We implement the Anthropic Messages API and the OpenAI Chat Completions API in the same gateway: Codable types for both protocols, two POST endpoints, input validation, mock inference.
    15. May 2026