This release is a pre-release and may not be stable for production use.
InferCrane Python SDK
Typed Python client for the InferCrane control API and OpenAI-compatible inference gateway. The package has no runtime dependencies and supports Python 3.10 or newer.
Install
For the public beta:
python -m pip install 'infercrane==1.0.0rc1'
Use the SDK version from the same InferCrane release as the control plane. Stable 1.0.0 remains
reserved for the stable release.
Configure
export INFERCRANE_CONTROL_URL=https://infercrane.internal
export INFERCRANE_API_KEY=YOUR_CONTROL_API_KEY
from infercrane import InferCrane
infercrane = InferCrane()
Pass base_url, gateway_url, or api_key to the constructor when environment configuration is not
appropriate. Use ca_file, cert_file, and key_file for a private CA or mutual TLS. Keep
control-plane credentials in trusted server processes.
Deploy and wait
operation = infercrane.deploy(
model="Qwen/Qwen3-8B",
name="support-production",
endpoint_name="support-production",
cloud="runpod",
gpu="L40S",
min_replicas=1,
max_replicas=2,
)
completed = infercrane.wait(operation.id, timeout=900)
print(completed.status)
print(completed.result.get("endpoint_name"))
name identifies the deployment operation. endpoint_name is the stable model alias used by the
application and defaults to name.
wait observes durable server-side work. A timeout or process exit does not cancel the operation.
Call cancel(operation.id) only when cancellation is intentional.
Stream inference
for event in infercrane.stream_chat(
"support-production",
[{"role": "user", "content": "Summarize the incident."}],
):
print(event, flush=True)
AsyncInferCrane provides the same common workflows for async applications.
Set an objective and request evidence
infercrane.set_slo_policy(
"support-production",
max_ttft_p95_ms=250,
max_error_rate=0.01,
)
recommendation = infercrane.recommend("support-production")
Recommendations preserve unavailable evidence instead of inventing a metric or price.
Errors and full API access
from infercrane import APIError, OperationFailed, OperationTimeout
try:
infercrane.wait(operation.id, timeout=30)
except OperationTimeout:
print("The operation is still running.")
except OperationFailed as error:
print(error.operation)
except APIError as error:
print(error.code, error.remediation)
The ergonomic methods cover common deployment and inference workflows. infercrane.api exposes the
complete generated control API with the same authentication and error contract.
See the Python SDK guide, control API, and security guidance.
License
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
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 infercrane-1.0.0rc1-py3-none-any.whl.
File metadata
- Download URL: infercrane-1.0.0rc1-py3-none-any.whl
- Upload date:
- Size: 15.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7484c87034dd88d15ff3f41e31cf38c7f3771a948d3b72fd2ef7b949f4e07a3f
|
|
| MD5 |
2a8b64a411ca11a49e128b5b7b5d4fee
|
|
| BLAKE2b-256 |
53d21187c9d02dd87fef5520b2e93dfbb9525a576e288412bbe0e623dcf0be14
|
Provenance
The following attestation bundles were made for infercrane-1.0.0rc1-py3-none-any.whl:
Publisher:
publish-stable.yml on infercrane/infercrane
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
infercrane-1.0.0rc1-py3-none-any.whl -
Subject digest:
7484c87034dd88d15ff3f41e31cf38c7f3771a948d3b72fd2ef7b949f4e07a3f - Sigstore transparency entry: 2617896946
- Sigstore integration time:
-
Permalink:
infercrane/infercrane@cb485d47bbf11306ddc5c3710f3159c234bce524 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/infercrane
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-stable.yml@cb485d47bbf11306ddc5c3710f3159c234bce524 -
Trigger Event:
workflow_dispatch
-
Statement type: