Metadata-Version: 2.4
Name: llm-hubris
Version: 0.1.1
Summary: LLM plugin for models hosted by Hubris
Author-email: Hubris <support@hubris.pw>
License-Expression: MIT
Project-URL: Homepage, https://github.com/Aimagine-life/llm-hubris
Project-URL: Documentation, https://hubris.pw/docs/integrations/llm
Project-URL: Changelog, https://github.com/Aimagine-life/llm-hubris/releases
Project-URL: Issues, https://github.com/Aimagine-life/llm-hubris/issues
Project-URL: CI, https://github.com/Aimagine-life/llm-hubris/actions
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: llm>=0.27
Requires-Dist: httpx
Dynamic: license-file

# llm-hubris

[![PyPI](https://img.shields.io/pypi/v/llm-hubris.svg)](https://pypi.org/project/llm-hubris/)
[![Changelog](https://img.shields.io/github/v/release/Aimagine-life/llm-hubris?include_prereleases&label=changelog)](https://github.com/Aimagine-life/llm-hubris/releases)
[![Tests](https://github.com/Aimagine-life/llm-hubris/actions/workflows/test.yml/badge.svg)](https://github.com/Aimagine-life/llm-hubris/actions/workflows/test.yml)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/Aimagine-life/llm-hubris/blob/main/LICENSE)

[LLM](https://llm.datasette.io/) plugin for models hosted by [Hubris](https://hubris.pw) — an OpenAI-compatible LLM gateway billed in Russian rubles, with 400+ models (OpenAI, Anthropic, Google, DeepSeek, Qwen and more) behind a single API key.

## Installation

First, [install the LLM command-line utility](https://llm.datasette.io/en/stable/setup.html).

Now install this plugin in the same environment as LLM.

```bash
llm install llm-hubris
```

## Configuration

You will need an API key from Hubris. Create one at [hubris.pw/keys](https://hubris.pw/keys).

You can set that as an environment variable called `HUBRIS_API_KEY`, or add it to the `llm` set of saved keys using:

```bash
llm keys set hubris
```
```
Enter key: <paste key here>
```

## Usage

The plugin registers every chat model from your Hubris catalog. To list them, run:

```bash
llm models list
```

You should see a list that looks something like this:

```
Hubris: hubris/anthropic/claude-sonnet-5
Hubris: hubris/openai/gpt-5.6-luna
Hubris: hubris/google/gemini-3.7-flash
Hubris: hubris/deepseek/deepseek-v4-flash-0731
...
```

Model IDs always use the full `vendor/model` form shown in the [Hubris catalog](https://hubris.pw/models) — there is no alias resolution on the gateway side.

The list is cached for an hour. Force a refresh with:

```bash
llm hubris refresh
```

To run a prompt against a model, pass its full model ID to the `-m` option:

```bash
llm -m hubris/anthropic/claude-sonnet-5 "Five spooky names for a pet tarantula"
```

You can set a shorter alias for a model using the `llm aliases` command:

```bash
llm aliases set sonnet hubris/anthropic/claude-sonnet-5
```

Now you can prompt it with:

```bash
cat llm_hubris.py | llm -m sonnet -s 'write some pytest tests for this'
```

Images are supported by vision models:

```bash
llm -m hubris/anthropic/claude-sonnet-5 'describe this image' -a https://static.simonwillison.net/static/2024/pelicans.jpg
```

Reasoning models accept the `reasoning_effort` option:

```bash
llm -m hubris/openai/gpt-5.6-luna -o reasoning_effort high 'Plan a three-day trip to Kazan'
```

### Listing models with prices

```bash
llm hubris models
```

Outputs every chat model with its context window and RUB prices per million tokens. Add `--json` for the raw catalog entries.

## Development

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

```bash
cd llm-hubris
python -m venv venv
source venv/bin/activate
```

Now install the dependencies and test dependencies:

```bash
pip install -e '.[test]'
```

To run the tests:

```bash
pytest
```
