Skip to main content

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().

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spt_models-0.2.0.tar.gz (38.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spt_models-0.2.0-py3-none-any.whl (24.4 kB view details)

Uploaded Python 3

File details

Details for the file spt_models-0.2.0.tar.gz.

File metadata

  • Download URL: spt_models-0.2.0.tar.gz
  • Upload date:
  • Size: 38.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.3

File hashes

Hashes for spt_models-0.2.0.tar.gz
Algorithm Hash digest
SHA256 09a8680714c93317b3168f8dc39993f5ba5a4e3e87d005df8562c9519377297b
MD5 b5814ae7806483447bc801a710fcd956
BLAKE2b-256 72cf7ae2759e2fd305029d5983480885ddc9e930e694fa483a68a5128ab41b9c

See more details on using hashes here.

File details

Details for the file spt_models-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: spt_models-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 24.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.3

File hashes

Hashes for spt_models-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 96217a6bfbe819fcbfe305f6668acd4f5db0bf03177c17c2e0525182bd88b60b
MD5 226dc3f1d1568617e4893e215c05f707
BLAKE2b-256 67adfb4e697c7ba9cfedd46e8c31af3f66ab4550dc1486fce8501de17e4488bf

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page