Metadata-Version: 2.5
Name: liulab-llms
Version: 2026.11.10
Summary: Calls language models for lab repos through one shared gateway, with a response cache for the whole lab and a spend ceiling.
Author: Liu Lab
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: >=3.13
Requires-Dist: fastjsonschema>=2.21
Provides-Extra: gateway
Requires-Dist: litellm==1.106.6; extra == 'gateway'
Requires-Dist: openai; extra == 'gateway'
Requires-Dist: psycopg-pool>=3.2; extra == 'gateway'
Requires-Dist: psycopg>=3.2; extra == 'gateway'
Requires-Dist: pypdf>=6; extra == 'gateway'
Requires-Dist: typesafe-sdk<0.8,>=0.7.5; extra == 'gateway'
Description-Content-Type: text/markdown

# liulab-llms

Calls language models for lab repos through one shared gateway, with a response cache for the whole lab and a spend ceiling.

## Set it up

This repo uses [pixi](https://pixi.sh) and nothing else — no pip, no conda, no uv.
Clone it, then:

```bash
pixi install
```

## Use it

Open an SSH tunnel to the lab gateway and set `LABLLM_GATEWAY` to its local address, such as
`http://127.0.0.1:8000`. Then open a meter with a dollar ceiling and call through it:

```python
from labllm import Gateway, Model, Stopped

gw = Gateway(repo="my-repo")
model = Model("deepseek", "deepseek-v4-flash", max_output_tokens=2000)
with gw.meter("first try", ceiling_usd=1.0) as m:
    try:
        reply = m.chat(model, system="Answer in one word.", user="Is DNA a protein?")
    except Stopped as stop:
        print("stopped:", stop.reason)
    else:
        print(reply.text, reply.cost_usd, reply.cached)
```

The same request sent again comes back from the cache at no cost. Tests use
`labllm.testing.FakeGateway` instead, with a function you write playing the provider.

## Check your work

```bash
pixi run check
```

That runs the linters, the type checker and the tests. It reports every failure at once, so read to
the bottom before you fix anything.

## Read the docs

The site is at <https://liuhlab.github.io/liulab-llms/>.
Build it yourself with `pixi run docs-build`.

## Set up your agent

Skills for coding agents live in `skills/`. Link them into each agent's own folder:

```bash
python skills/install.py --target all
```

If you work on the lab's clusters, add the shared plugin once per machine:

```text
/plugin marketplace add liuhlab/liulab-skills
/plugin install lab@liulab
```
