Metadata-Version: 2.4
Name: servo-client
Version: 0.7.8
Summary: Python SDK for Servo's hosted model inference API
Project-URL: Documentation, https://servo.mintlify.app/
Requires-Python: >=3.12
Description-Content-Type: text/markdown
Requires-Dist: av>=12
Requires-Dist: cryptography>=42
Requires-Dist: httpx[http2]
Requires-Dist: mcap>=1.3
Requires-Dist: msgpack>=1.0.5
Requires-Dist: numpy>=1.26
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.44
Requires-Dist: opentelemetry-sdk>=1.44
Requires-Dist: pillow>=9
Requires-Dist: psutil>=6
Requires-Dist: pydantic>=2
Requires-Dist: pyyaml>=6
Requires-Dist: requests>=2.31
Requires-Dist: protobuf<7,>=6.33.6

# servo-client

Python and CLI access to Servo's hosted model inference service. Requires Python 3.12+.

```bash
pip install servo-client
servo login
```

A machine can use its organization API key through `SERVO_API_KEY` instead. Set
`SERVO_BASE_URL` when using a different control plane.

Import a pi0.5 checkpoint and deploy near your application:

```python
import numpy as np
import servo

sv = servo.Servo()
model = sv.models.import_checkpoint(
    "https://huggingface.co/npow/pi05-yam-red-cap-full-7500",
    revision="39c6876521b3d8363452bed6731c8705b3944c24",
)
deployment = model.deploy(city="Zurich, Switzerland").wait(timeout_s=900)
policy = deployment.policy()
inputs = {
    "middle": np.load("middle.npy"),
    "left": np.load("left.npy"),
    "right": np.load("right.npy"),
    "state": np.load("state.npy"),
}
with sv.session(policy, instruction="pick up the red cap") as session:
    chunk = session.predict(inputs=inputs)
print(chunk.actions)
```

Your application supplies arrays matching `policy.input_contract`. The inspected checkpoint
specifies image dimensions, state shape, and output shape. Servo handles checkpoint loading,
preparation, private endpoint access, and prediction; it does not control physical devices.

Save `deployment.id` and reconnect with `sv.deployments.get(deployment_id)`. Deployment remains
running until stopped with `deployment.delete()` or `servo deployment stop <deployment-id>`.
A local timeout does not stop remote preparation or deployment; inspect status before retrying.

[Quickstart](https://servo.mintlify.app/quickstart)

## Third-party notices

The Linux platform wheels ship Tailscale's `tailscaled` and `tailscale` executables
(`servo/_native/`), redistributed unmodified under the BSD 3-Clause license. The license, patent
grant, and the notices for the dependencies compiled into them are installed with the package
under `servo/licenses/tailscale/`.
