Metadata-Version: 2.5
Name: spt-models
Version: 0.2.0
Summary: Python client for the SPT Models GPU inference platform
Project-URL: Homepage, https://models.sponge-theory.dev
Project-URL: Repository, https://github.com/sponge-theory/spt-models
Project-URL: Documentation, https://github.com/sponge-theory/spt-models/tree/main/spt-models-python
Author-email: Sponge Theory <dev@sponge-theory.dev>
License-Expression: MIT
License-File: LICENSE
Keywords: ai,api-client,gpu,inference,llm,ml,openai
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.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: httpx<1,>=0.27
Requires-Dist: pydantic<3,>=2
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
Requires-Dist: pytest-httpx>=0.34; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: respx>=0.22; extra == 'dev'
Requires-Dist: ruff>=0.8; extra == 'dev'
Description-Content-Type: text/markdown

# spt-models

Python client for the SPT Models GPU inference platform.

## Model aliases

An admin can publish client-facing names (`gpt-4`, `prod-embeddings`, …) that
point at a catalogue model. Every `/v1/*` call accepts an alias wherever it
accepts a slug, and echoes the alias back in the response `model` field.
`client.admin.aliases` manages them (admin token required); `Model.alias_of`
tells an alias entry apart from a real model in `client.models.list()`.

```python
from spt_models import Client

with Client(api_key="sk-...", admin_token="...") as client:
    # Create an alias pointing at model id 1, then use it like a slug.
    alias = client.admin.aliases.create("gpt-4", 1, description="OpenAI drop-in")
    resp = client.chat.completions.create(
        model="gpt-4", messages=[{"role": "user", "content": "Hello"}]
    )
    assert resp.model == "gpt-4"          # the alias is echoed, not the slug

    # Repoint, disable, or drop it — clients keep the same name throughout.
    client.admin.aliases.update(alias.id, model_id=2)
    client.admin.aliases.update(alias.id, enabled=False)
    client.admin.aliases.delete(alias.id)

    for m in client.models.list().data:
        if m.alias_of:
            print(f"{m.id} -> {m.alias_of}")
```

Async variants follow the usual `a` prefix: `alist`, `acreate`, `aupdate`, `adelete`.
