Metadata-Version: 2.4
Name: llm-openzoo
Version: 0.1.0
Summary: LLM plugin for models hosted by OpenZoo - no signup required
Author-email: staccDOTsol <jarettrsdunn@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://openzoo.fun
Project-URL: Issues, https://github.com/staccDOTsol/llm-openzoo/issues
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: llm>=0.26
Requires-Dist: httpx
Dynamic: license-file

# llm-openzoo

[LLM](https://llm.datasette.io/) plugin for models hosted by [OpenZoo](https://openzoo.fun) — an OpenAI-compatible inference endpoint with **no signup**: any API key value works and billing happens per call via x402 or card.

## Installation

Install this plugin in the same environment as [LLM](https://llm.datasette.io/):

```bash
llm install llm-openzoo
```

## Usage

No API key is needed — the plugin defaults to the conventional `sk-openzoo` key. Models show up automatically:

```bash
llm models | grep openzoo
```

Run a prompt (note: completions are billed per call):

```bash
llm -m openzoo/z-ai/glm-5.3-flash "Three names for a pet zebra"
```

Streaming works by default; add `--no-stream` to disable it.

If you want to set an explicit key anyway (any value is accepted; useful for tagging your calls):

```bash
llm keys set openzoo
# or
export OPENZOO_API_KEY=sk-openzoo
```

### Local gateway

To route through a local [`npx openzoo`](https://openzoo.fun) gateway instead of the hosted endpoint:

```bash
export OPENZOO_BASE_URL=http://localhost:8402/v1
```

### Listing models

The plugin fetches the free model catalog from `https://api.openzoo.fun/v1/models` and caches it for one hour.

```bash
llm openzoo models            # human-readable list with pricing
llm openzoo models --free     # only free models
llm openzoo models --json     # raw JSON
llm openzoo refresh           # force-refresh the cached catalog
```

## Development

To set up this plugin locally, first checkout the code. Then create a new virtual environment:

```bash
cd llm-openzoo
python -m venv venv
source venv/bin/activate
pip install -e '.[test]' || pip install -e . pytest pytest-httpx
```

Run the tests:

```bash
pytest
```

The live test that hits the real OpenZoo API is skipped by default; enable it with:

```bash
OPENZOO_LIVE_TESTS=1 pytest
```
