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.1.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.1-py3-none-any.whl (73.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: litecoo-2.4.1.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.1.tar.gz
Algorithm Hash digest
SHA256 64ecf9ebe760a81438b5f0dc8f78661bf9098a3dd17fb332e575975660397570
MD5 4e8688de6e2202cc69f073e1f3871e28
BLAKE2b-256 ad9f4171c4e447dcc73e03c2416e993cd71e09db421d7a492022be81293607ab

See more details on using hashes here.

File details

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

File metadata

  • Download URL: litecoo-2.4.1-py3-none-any.whl
  • Upload date:
  • Size: 73.0 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 763a08dd7d768a918d92fc6e23ebce9e17837bd32568bc334d6dbcd62a84b271
MD5 3e3a38ae11a7bc4a37af13e968fbf67a
BLAKE2b-256 d0b2f56fdf1010654576c19ffe826e8da11327e02ffdcc2567e965e340059562

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