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-1.0.0.tar.gz (36.0 kB view details)

Uploaded Source

Built Distribution

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

litecoo-1.0.0-py3-none-any.whl (39.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for litecoo-1.0.0.tar.gz
Algorithm Hash digest
SHA256 536084ae9479bbe3fdec751c1040b89fed31db2110a4a7a985409bf2e18e1488
MD5 a4c31692afe760def8249d75256229f8
BLAKE2b-256 e86b23fbf01d3f0796634eb9a48099e1947dc2729f1b4f60b09df89785899746

See more details on using hashes here.

File details

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

File metadata

  • Download URL: litecoo-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 39.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-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 61e06fc4db463beb23256fd4f36ee215ef30d4e10f9485615f498accd7a97e2a
MD5 207c0b39655aaf68435aef772be04eda
BLAKE2b-256 0f8192dbe252e822c50f45e549201a3a271d5491c11b7ab99ccc395fa4f1cfc3

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