Skip to content
tiennm99devPublic

About

Personal LLM proxy, a lighter LiteLLM: one endpoint for many model providers (rework in progress)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

mtllm

The name reads as "empty LLM": mt is the author's initials, and it also sounds like "empty".

mtllm is a tiny LLM proxy in Go, a much lighter take on LiteLLM. It serves both the OpenAI Chat Completions API (/v1/chat/completions) and the Anthropic Messages API (/v1/messages), and routes each request to an OpenAI-compatible or Anthropic provider named in one config.yml. It also passes OpenAI Embeddings (/v1/embeddings) through to OpenAI-compatible providers. When the client's format and the provider's differ, it translates requests, responses and streams; when they match, it passes the body through with only the model rewritten. It serves chat and embeddings only: a request that asks for tools gets a 400 tool calls are not supported. It is one static binary with no database, UI, retries or fallbacks.

Quick start

Write a config.yml (full reference in docs/configuration.md):

client_keys:
  - ${MTLLM_CLIENT_KEY}

providers:
  openrouter:
    api_key: ${OPENROUTER_API_KEY}

models:
  sonnet: openrouter/anthropic/claude-sonnet-4.5

Run it with Docker:

docker build -t mtllm .
docker run --rm -p 8080:8080 \
  -v "$PWD/config.yml:/app/config.yml:ro" \
  -e MTLLM_CLIENT_KEY -e OPENROUTER_API_KEY \
  mtllm

Or with Go (1.27 or newer):

go run . -config config.yml

Check it:

curl -s localhost:8080/health
curl -s localhost:8080/v1/chat/completions \
  -H "Authorization: Bearer $MTLLM_CLIENT_KEY" -H 'Content-Type: application/json' \
  -d '{"model":"sonnet","messages":[{"role":"user","content":"Hi"}]}'

Docs

License

Apache-2.0

About

Personal LLM proxy, a lighter LiteLLM: one endpoint for many model providers (rework in progress)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages