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.
pip install logits-sdkThe SDK reads your Logits API key from the LOGITS_API_KEY environment variable.
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()Install the package and test dependencies:
python -m pip install -e .
python -m pip install pytest pytest-timeout respxRun the test suite:
pytestBuild and validate release artifacts:
python -m pip install build twine
python -m build
python -m twine check dist/*- 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.