← Doku

1 Min. Lesezeit

Dokumentation
Auf dieser Seite
  1. Short-lived jobs

The Python SDK

pip install fl-client-sdk
from fl_client_sdk import FLClient

with FLClient.from_env() as client:      # enrols, then keeps the model hot
    out = client.predict([{"features": [0.1, 0.2, 0.3, 0.4]}])
    print(out["served_version"], out["predictions"])

    client.ingest({"temp": 21.5, "faulty": False}, subject_id="user-123")

Short-lived jobs

For a short-lived job that doesn't want a background thread:

client = FLClient.from_env(start=False)
client.sync()          # one check-in + fetch + hot-swap
client.predict([...])

Configuration comes from the environment for both this SDK and the sidecar — see Configuration.