Problem
An existing open-source gateway needed improvements across proxying, authentication, analytics and routing.
Constraints
Contribution work had to fit the existing project rather than replace its architecture.
What I did
This started as a curiosity project. I contributed 13 pull requests to twodayslate/gateway, an open-source API and LLM gateway built on Cloudflare Workers.
This was contribution work, not greenfield ownership. The job was to understand the existing design, find the right extension point, improve the behavior, and get the change merged — without rewriting the project into my preferred architecture.
Scope
The contributions hit the operational parts of the gateway:
- request and body proxying
- deployment pipeline behavior
- D1 request analytics
- header- and query-based authentication
- cron-driven data retention
- GET request semantics
- Cloudflare AI Gateway routing to downstream model providers
Between them, they changed how requests move, how callers authenticate, how usage is recorded, how old data is removed, and how provider routing stays replaceable.
What it reinforced
Workers put a gateway right next to the request and compose cleanly with D1 and AI Gateway. TypeScript makes the request contracts explicit. D1 gives you a durable operational record without standing up a separate database for a small gateway.
And contributing to someone else's project means preserving their mental model while improving it. The best patch is usually the one that strengthens the existing boundary rather than announcing a new one.
Result
13 merged pull requests to twodayslate/gateway.
Tradeoffs
Small changes at established extension points preserve the project maintainers’ architecture while improving operational behavior.