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.0.1.tar.gz (61.5 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.0.1-py3-none-any.whl (70.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for litecoo-2.0.1.tar.gz
Algorithm Hash digest
SHA256 e5d2194b330389d11a7e5d0d3ed989176866d0f01f39078a13d7699b1883ed6a
MD5 96c7648d03d601a768714f1b43c2bcdb
BLAKE2b-256 c3ee73531f90d094ab53d26c425b3cec9b58a07283ea1293d1ad8fff51d7d22f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: litecoo-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 70.3 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.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a947539f789cc534159ddbd48c03be4ce3af2fbe99c54546decbc7f7fb994e44
MD5 ac7a8db68ecbbd3a35e702afa732cc13
BLAKE2b-256 ef31d5b9b48fca177d0a1bbd8eeb9f9422ccfd92b458235bab1138a5b9914863

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