sie-sdk-rs
Rust client for the SIE inference server.
Embeddings, reranking, extraction and text generation, with the server's capacity signals handled for you.
[]
= "0.1"
The crate is sie-sdk-rs; the library it exposes is sie_sdk, so imports read
use sie_sdk::....
Quick start
use ;
async
What it covers
| Area | API |
|---|---|
| Embeddings | encode |
| Reranking | score |
| Extraction | extract |
| Generation | generate, chat, responses, and .stream() on each |
| Cost | estimate, or .estimate() on a generation builder |
| Files & batches | files(), batches() |
| Batch jobs | jobs(), inline or connector-driven |
| Capacity | pools(), get_capacity, wait_for_capacity |
| Cluster status | watch() over WebSocket |
| Connections | connections() on the control plane |
| Local scoring | maxsim, maxsim_batch for late-interaction models |
Waiting for capacity
SIE scales from zero and loads models on demand, so a request can legitimately be
answered with "not yet". The client absorbs that: PROVISIONING, MODEL_LOADING,
LORA_LOADING and RESOURCE_EXHAUSTED are retried inside a wall-clock budget
(15 minutes by default) with bounded, jittered backoff. Generation is not idempotent,
so it never replays a request that may already have reached a worker.
Opt out per call when a failure is more useful than a wait:
let result = client
.encode
.wait_for_capacity
.max_oom_retries
.send_one
.await;
if let Err = &result
&& error.is_capacity_error
Every call also reports what it cost and how hard it worked, through
result.request: the request id, billed units, credits, and the number of retries.
Streaming
use StreamExt;
use ChatMessage;
let mut stream = client.chat.stream?;
while let Some = stream.next.await
Features
| Feature | Default | Effect |
|---|---|---|
rustls-tls |
yes | TLS through rustls |
native-tls |
no | TLS through the platform library |
watch |
yes | Client::watch over WebSocket |
blocking |
no | sie_sdk::blocking::Client, for non-async callers |
ndarray |
no | Conversions into ndarray arrays |
The blocking client owns a runtime and runs the async one:
use ;
let client = new?;
let result = client.call?;
Testing
cargo test runs unit tests plus an HTTP suite against a mock server. There is also a
suite that runs against a real deployment, ignored by default:
SIE_BASE_URL=http://localhost:8080
It discovers models from the server's own catalogue by capability, so it adapts to whatever bundle a deployment serves; anything unavailable skips itself and says why.
Relationship to the Python SDK
Feature parity with sie_sdk on the client side, designed for Rust rather than
transliterated:
- One async implementation, with
blockingas a thin facade, instead of two mirrored clients. - One
Errorenum with predicates in place of an exception hierarchy. - Retry counts and model revisions arrive in
RequestMetadatarather than in thread-local state. LORA_LOADINGretries are clamped to the caller's budget, and a stream reconnect honours the connection'sRetry-After; the Python SDK does neither.- Metadata endpoints (
list_models,get_model,/health) are single-shot rather than sitting inside the provisioning budget. - The server-side helpers bundled into the Python package (object-store backends, the HuggingFace weight cache, bundle matching) are out of scope for a client.
License
Apache-2.0