Skip to main content

The official Python SDK for the Logits platform (import as `logits`)

Project description

Logits Python SDK

logits-sdk is the official Python SDK for the Logits platform. Install it under the distribution name logits-sdk; application code imports it as logits.

Installation

pip install logits-sdk

Authentication

The SDK reads your Logits API key from the LOGITS_API_KEY environment variable.

Usage

import logits

service_client = logits.ServiceClient()
sampling_client = service_client.create_sampling_client(base_model="Qwen/Qwen3-8B")
future = sampling_client.sample(
    prompt=logits.ModelInput.from_ints([1, 2, 3]),
    num_samples=1,
    sampling_params=logits.SamplingParams(max_tokens=32),
)
result = future.result()

Async usage:

import logits

service_client = logits.ServiceClient()
sampling_client = await service_client.create_sampling_client_async(
    base_model="Qwen/Qwen3-8B"
)
result = await sampling_client.sample_async(
    prompt=logits.ModelInput.from_ints([1, 2, 3]),
    num_samples=1,
    sampling_params=logits.SamplingParams(max_tokens=32),
)

Close the underlying holder when a long-running process no longer needs the client:

service_client.holder.close()

Development

Install the package and test dependencies:

python -m pip install -e .
python -m pip install pytest pytest-timeout respx

Run the test suite:

pytest

Build and validate release artifacts:

python -m pip install build twine
python -m build
python -m twine check dist/*

Release Checklist

  • Bump both pyproject.toml and src/logits/_version.py.
  • Run pytest, python -m build, and python -m twine check dist/*.
  • Confirm GitHub Actions CI is green on the release commit.
  • Create a GitHub release from the version tag to trigger the publish workflow.

Project details


Download files

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

Source Distribution

logits_sdk-0.1.2.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

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

logits_sdk-0.1.2-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file logits_sdk-0.1.2.tar.gz.

File metadata

  • Download URL: logits_sdk-0.1.2.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for logits_sdk-0.1.2.tar.gz
Algorithm Hash digest
SHA256 7ee5f1d56685e32086c51b955294aca9b8f8470923f252d491b7a7223047358c
MD5 3aefc46b49a1cbe0349c3c3cba050809
BLAKE2b-256 c722a929926e1cd19fe94c4b07fdc4044f3176f18868921070cefa18cf5c5ea8

See more details on using hashes here.

Provenance

The following attestation bundles were made for logits_sdk-0.1.2.tar.gz:

Publisher: publish.yml on GradientHQ/logits

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file logits_sdk-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: logits_sdk-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for logits_sdk-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1a340cbc6353310815b80084cf315565e8fed0557fb396c352f843c74664224e
MD5 e9abfab6e13fb4e6a087b005f25b6155
BLAKE2b-256 b20e5c46e08ab40e45bff3c8705af30b95e1d539bce9ba5efb20edbbde3f4d79

See more details on using hashes here.

Provenance

The following attestation bundles were made for logits_sdk-0.1.2-py3-none-any.whl:

Publisher: publish.yml on GradientHQ/logits

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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