The Logits Python SDK facade over the official Tinker SDK (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
Set a Logits API key before creating clients:
export LOGITS_API_KEY="your-api-key"
For non-default deployments, set a base URL:
export LOGITS_BASE_URL="https://api.example.com"
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.tomlandsrc/logits/_version.py. - Run
pytest,python -m build, andpython -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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file logits_sdk-0.1.0.tar.gz.
File metadata
- Download URL: logits_sdk-0.1.0.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d9db4d779b04d79a6d089e753ab634158d29e1606c6be054ca45b34d6915064
|
|
| MD5 |
597b67bed69b2fd995bb0bea25d23251
|
|
| BLAKE2b-256 |
5895d06c855b5cb7048a0bb32384f3199ba4c65efad8eb63759da36b9681182c
|
Provenance
The following attestation bundles were made for logits_sdk-0.1.0.tar.gz:
Publisher:
publish.yml on GradientHQ/logits
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
logits_sdk-0.1.0.tar.gz -
Subject digest:
1d9db4d779b04d79a6d089e753ab634158d29e1606c6be054ca45b34d6915064 - Sigstore transparency entry: 1627190643
- Sigstore integration time:
-
Permalink:
GradientHQ/logits@30085c5d70124baef164ad22b4f39ab5e36e2d9d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/GradientHQ
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@30085c5d70124baef164ad22b4f39ab5e36e2d9d -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file logits_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: logits_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3fd82ccecee9a5bf009d2aff248c8a9c4a3c60042860602d87d5479c6d842b7e
|
|
| MD5 |
16b941d6f158a7135d97927ff5e02925
|
|
| BLAKE2b-256 |
84f2e6930478879c67c4bb53cb0c18594ba2b6def1c0f564fd025064453f92a8
|
Provenance
The following attestation bundles were made for logits_sdk-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on GradientHQ/logits
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
logits_sdk-0.1.0-py3-none-any.whl -
Subject digest:
3fd82ccecee9a5bf009d2aff248c8a9c4a3c60042860602d87d5479c6d842b7e - Sigstore transparency entry: 1627190744
- Sigstore integration time:
-
Permalink:
GradientHQ/logits@30085c5d70124baef164ad22b4f39ab5e36e2d9d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/GradientHQ
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@30085c5d70124baef164ad22b4f39ab5e36e2d9d -
Trigger Event:
workflow_dispatch
-
Statement type: