Skip to content

Architecture

Runtime flow

text
Browser
  │ localhost:8877 or tailnet-only Tailscale Serve

Cloudflare OS container
  │ http://litellm:4000/v1

Project-local LiteLLM


Model provider route

Responsibilities

ComponentResponsibility
Cloudflare OSWorkspace UI, chat history, agent loop, Gadget tools, reviewable drafts
LiteLLMOpenAI-compatible gateway, provider routing, model aliases, master-key auth
Docker ComposePrivate service networking and repeatable startup
Tailscale ServeOptional tailnet-only HTTPS access to the local port
QA scriptsBrowser flows and screenshot evidence without storing credentials

Why the internal URL matters

The Cloudflare OS container cannot use localhost to reach the LiteLLM container. The Compose service name litellm resolves on the project network, so the correct in-network URL is http://litellm:4000/v1.

The host diagnostic port is separate and binds to localhost only. This keeps the model gateway out of the public network path.

Agent boundary

Cloudflare OS owns the agent loop and tool definitions such as creating a Gadget, writing or editing files, and executing code. LiteLLM only provides model access; it does not turn a normal chat request into an agent by itself.

Source boundary

The wrapper pins the upstream source revision recorded in THIRD-PARTY-NOTICES.md. The upstream license remains in upstream/cloudflare-os/LICENSE. This repository is an unofficial local integration.

Unofficial local integration for research and personal use.