Skip to main content

Free LLM proxy for Cowork and OpenAI-compatible clients — no litellm, pure httpx routing

Project description

litecoo (litecoo v3)

litecoo (formerly litecoo) is a local FastAPI proxy that makes free LLM models (DeepSeek V4, Gemma, Nemotron) behave like Claude for Cowork Desktop and Claude Code. It handles the Anthropic protocol, agentic tool loops, session memory, and built-in tools — all without spending a cent on API calls.


🚀 System Architecture

graph TD
    Client[Client (Cowork / curl)] --> API[FastAPI Proxy]
    API --> Router[Model Router]
    
    subgraph Core Features
        Router --> Memory[SQLite Session Memory]
        Router --> AgentLoop[Server-Side Agent Loop]
        Router --> RateLimit[Cooldown / Rate Limiting]
    end
    
    subgraph Built-in Tools
        AgentLoop --> Fetch[Web Fetch]
        AgentLoop --> Search[Web Search]
        AgentLoop --> Bash[Bash Command]
        AgentLoop --> FileOps[File Read/Write]
        AgentLoop --> Office[Create PDF/DOCX/PPTX]
    end
    
    Router --> Provider[OpenRouter / DeepSeek / External APIs]

🛠️ Endpoints

Endpoint Format Description
POST /v1/messages Anthropic For Claude Desktop and Cowork. Handles tool loops and SSE streaming.
POST /v1/chat/completions OpenAI For standard OpenAI clients, Claude Code, curl.
GET /v1/models Standard Returns the list of available aliases.
GET /v1/sessions/{id} Internal Inspect a session's history.
DELETE /v1/sessions/{id} Internal Clear a session from SQLite.
GET /v1/cooldowns Internal Check rate limit status for each model.
GET /v1/usage Internal Review token usage stats.

📦 Built-in Tools

If the client doesn't send its own tool definitions, litecoo automatically injects these tools:

  • web_fetch, web_search: DuckDuckGo and basic page scraping.
  • bash: Local command execution.
  • read_file, write_file: Read and write to disk.
  • create_pdf, create_docx, create_pptx, create_xlsx: Generate rich documents.

Add the header X-Agent-Loop: server to let litecoo automatically execute multi-step tools server-side before returning the final text to the client.


💻 Installation

To run it locally or use it as a library, install directly from source:

python -m venv venv
# On Windows: venv\Scripts\activate
# On Mac/Linux: source venv/bin/activate

pip install litecoo

Then run the proxy:

litecoo --host 0.0.0.0 --port 8000 --env-file .env

🔌 Connecting Clients

Claude Desktop: Settings → Developer → API base URL → http://localhost:8000

Claude Code:

export ANTHROPIC_BASE_URL=http://localhost:8000
export ANTHROPIC_API_KEY=any-string
claude

⬆️ How to Publish to PyPI

If you are a developer and want to push the latest changes to PyPI, follow these steps:

  1. Install build tools:

    pip install build twine
    
  2. Build the wheel and source distribution:

    python -m build
    

    This creates a dist/ directory with a .tar.gz and .whl file.

  3. Upload to PyPI:

    python -m twine upload dist/*
    

    You will be prompted for your PyPI API token (username __token__).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

litecoo-2.3.3.tar.gz (63.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

litecoo-2.3.3-py3-none-any.whl (72.7 kB view details)

Uploaded Python 3

File details

Details for the file litecoo-2.3.3.tar.gz.

File metadata

  • Download URL: litecoo-2.3.3.tar.gz
  • Upload date:
  • Size: 63.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for litecoo-2.3.3.tar.gz
Algorithm Hash digest
SHA256 b780928f4661923cd3c039c7ed98ce2a356f6abec7a384a5e46d65c693adf7a9
MD5 42b6e40b40479f9780cc138d6343b961
BLAKE2b-256 6182a56c25707241996b90a67c4af9db99ea75c4d1019a8fecc04521f4fd1eff

See more details on using hashes here.

File details

Details for the file litecoo-2.3.3-py3-none-any.whl.

File metadata

  • Download URL: litecoo-2.3.3-py3-none-any.whl
  • Upload date:
  • Size: 72.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for litecoo-2.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 2d548eec4f7bb8443ae89b41334eb32ab0dae536e5889b904850a2e9f67d220e
MD5 9e22e551d7b684285b7ad33ea514c5f4
BLAKE2b-256 c912f4751b4b1726a3a3565744313fbcb4faa5600f6d20d9a6aea69488ccb2b2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page