Skip to content
GottenHeavePublic
forked from Xerxes-2/clewdr

About

High Performance LLM Reverse Proxy

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

ClewdR

ClewdR

ClewdR is a Rust proxy for Claude (Claude.ai, Claude Code).
It keeps resource usage low, serves OpenAI-style endpoints, and ships with a Leptos/WASM admin UI for managing cookies and settings.


Highlights

  • Works with Claude web and Claude Code.
  • Single static binary for Linux, macOS, Windows, and Android; Docker image available.
  • Web dashboard shows live status and supports hot config reloads.
  • Drops into existing OpenAI-compatible clients while keeping native Claude formats.
  • Typical production footprint: <10 MB RAM, <1 s startup, ~15 MB binary.

Supported Endpoints

Service Endpoint
Claude.ai http://127.0.0.1:8484/v1/messages
Claude.ai session reset http://127.0.0.1:8484/v1/sessions/reset
Claude.ai staged files http://127.0.0.1:8484/v1/files
Claude.ai remote file download GET http://127.0.0.1:8484/v1/sessions/{session_id}/files/download?path=...
Claude.ai OpenAI compatible http://127.0.0.1:8484/v1/chat/completions
Claude Code http://127.0.0.1:8484/code/v1/messages
Claude Code OpenAI compatible http://127.0.0.1:8484/code/v1/chat/completions

Streaming responses are available on messages and chat/completions routes.

Versioned explicit sessions use metadata.user_id values beginning with cherry_topic_v1_. ClewdR binds each session to its selected Cookie, Claude Web conversation, and parent message. Requests for the same session execute in order, and concurrent identical requests share the completed response. ClewdR automatically resets and rebuilds a session once when reuse validation, an uncertain result, or upstream expiration prevents reuse. A repeated failure is returned to the client. Explicit-session streams are buffered until Claude Web emits message_stop, then delivered as SSE; the first downstream byte waits for completion validation and memory use grows with the response body, up to a 16 MiB limit. A larger response returns 502 explicit_response_too_large. Streaming without an explicit session remains incremental. Expired staged files still require a new upload.

When an explicit-session response names a file under /mnt/user-data/outputs/, ClewdR appends a Download Files section. Set public_base_url to make those links absolute, or leave it unset to use relative /v1/... links. The download endpoint is public; treat each explicit session ID as an output-file access capability.

Upload large files to /v1/files as multipart form data containing exactly one field named file. The returned file_clewdr_v1_* ID can be referenced by image, document, and container upload content blocks in an explicit session. Staged files require filesystem persistence; with --no-fs, the upload endpoint and messages that reference staged IDs return 501 staged_files_unavailable.

Quick Start

  1. Download the latest release for your platform from GitHub.
    Linux/macOS example:
    curl -L -o clewdr.tar.gz https://github.com/Xerxes-2/clewdr/releases/latest/download/clewdr-linux-x64.tar.gz
    tar -xzf clewdr.tar.gz && cd clewdr-linux-x64
    chmod +x clewdr
  2. Run the binary:
    ./clewdr
  3. Open http://127.0.0.1:8484 and enter the admin password shown in the console (or container logs if using Docker).

Using the Web Admin

  • Dashboard shows health, connected clients, and rate-limit status.
  • Claude tab stores browser cookies; paste cookie: value pairs and save.
  • Settings lets you rotate the admin password, set upstream proxies, and reload config without restarting.

If you forget the password, delete clewdr.toml and start the binary again. Docker users can mount a persistent folder for that file.

Configure Upstreams

Claude

  1. Export your Claude.ai cookies (e.g., via browser devtools).
  2. Paste them into the Claude tab; ClewdR tracks their status automatically.
  3. Optionally set an outbound proxy or fingerprint overrides if Claude blocks your region.

Client Examples

SillyTavern:

{
  "api_url": "http://127.0.0.1:8484/v1/chat/completions",
  "api_key": "password-from-console",
  "model": "claude-sonnet-5"
}

Continue (VS Code):

{
  "models": [
    {
      "title": "Claude via ClewdR",
      "provider": "openai",
      "model": "claude-sonnet-5",
      "apiBase": "http://127.0.0.1:8484/v1/",
      "apiKey": "password-from-console"
    }
  ]
}

Cursor:

{
  "openaiApiBase": "http://127.0.0.1:8484/v1/",
  "openaiApiKey": "password-from-console"
}

Resources

Thanks

  • wreq for the fingerprinting library.
  • Clewd for many upstream ideas.
  • Clove for Claude Code helpers.

About

High Performance LLM Reverse Proxy

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages