Metadata-Version: 2.4
Name: litecoo
Version: 2.4.1
Summary: Free LLM proxy for Cowork and OpenAI-compatible clients — no litellm, pure httpx routing
Project-URL: Homepage, https://github.com/Saisharathchandranandnetha/KrishiMitra_Beast
Project-URL: Repository, https://github.com/Saisharathchandranandnetha/KrishiMitra_Beast
License: MIT
Keywords: anthropic,cowork,free,litecoo,llm,openai,proxy
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
Requires-Python: >=3.10
Requires-Dist: aiosqlite>=0.20.0
Requires-Dist: chromadb>=0.5.0
Requires-Dist: fastapi<0.129.0,>=0.128.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: mcp[cli]>=1.1.2
Requires-Dist: openpyxl>=3.1.2
Requires-Dist: pydantic>=2.12.3
Requires-Dist: python-docx>=1.1.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: python-pptx>=0.6.23
Requires-Dist: pyyaml>=6.0.1
Requires-Dist: questionary>=2.0.0
Requires-Dist: reportlab>=4.1.0
Requires-Dist: rich>=13.0.0
Requires-Dist: uvicorn<0.41.0,>=0.40.0
Provides-Extra: dev
Requires-Dist: httpx; extra == 'dev'
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: pytest-asyncio; extra == 'dev'
Description-Content-Type: text/markdown

# 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

```mermaid
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:

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

pip install litecoo
```

Then run the proxy:
```bash
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:**
```bash
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:**
   ```bash
   pip install build twine
   ```

2. **Build the wheel and source distribution:**
   ```bash
   python -m build
   ```
   *This creates a `dist/` directory with a `.tar.gz` and `.whl` file.*

3. **Upload to PyPI:**
   ```bash
   python -m twine upload dist/*
   ```
   *You will be prompted for your PyPI API token (username `__token__`).*
