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.4.0.tar.gz (63.9 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.4.0-py3-none-any.whl (72.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for litecoo-2.4.0.tar.gz
Algorithm Hash digest
SHA256 026fa46cdaa13b62560b4ca8f7d61ca540cdc39e81eaf910bd9dcfa859b54f81
MD5 2adf990292d64343a42e9c24b196a066
BLAKE2b-256 d4870745ddb17cd05a9a492b8d47f467d999e0bd3dc5637c82fe7f01fae805f3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: litecoo-2.4.0-py3-none-any.whl
  • Upload date:
  • Size: 72.9 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.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 00b6cb2db6368f3c97db2748bbc95b6decc4db20547772a13ef4bbb451a46eaf
MD5 0c4efc8516a7c13deb51b0c75e42d17f
BLAKE2b-256 6718ed8a7e72829b050ef15332536227bad05bb268576e2df45a162c04b996a2

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