Metadata-Version: 2.5
Name: abstract-client
Version: 0.4.2
Summary: Abstract's robot API from Python: action chunks from served robot models, sync and asyncio.
Project-URL: Homepage, https://abstract.inc
Project-URL: Documentation, https://docs.abstract.inc
License-Expression: Apache-2.0
License-File: LICENSE
License-File: NOTICE
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: av<20,>=17
Requires-Dist: httpx2<3,>=2.12
Provides-Extra: quic
Requires-Dist: aioquic<2,>=1.3; extra == 'quic'
Description-Content-Type: text/markdown

# abstract.client

Abstract's robot API from Python. A `Client` holds your key and its connections and is safe to
share between threads; each `Policy` is one episode of one served robot model doing one task, one
action chunk per `predict()`.

```sh
uv add abstract-client
```

The API takes 0.4.0 or later. Earlier releases send JSON with JPEG frames, which the API no
longer takes: on `get_action` they are refused with `400 unsupported_api_version`, which names
this upgrade.

### Quickstart (0.3.0)

```python
import abstract

checkpoint = "allenai/molmoact2"
embodiment = "yam"
client = abstract.client(ABSTRACT_API_KEY, checkpoint, embodiment)

client.set_observation(frames, observation)
action = client.get_action()
client.reset_episode()
client.close()
```

`ABSTRACT_API_KEY` is your key, `frames` maps each camera to one frame (an RGB array, height
x width x 3 uint8, or a JPEG as bytes), and `observation` holds `prompt` (the task) and
`state` (measured alongside the frames). Every frame crosses as H.264; see "Video" below. The YAM camera and
state fields are shown below. The returned `Chunk` contains targets, never hardware motion;
reset ends the model's episode without repositioning the robot.

`abstract.client()` checks the account's unmetered model catalogue before configuring a
`RobotClient`. The checkpoint must be available and its `robot` must match `embodiment`.
An optional URDF layer converts poses to another arm's joint geometry; it does not establish
policy transfer. Omit `api_key` to use the environment or saved
CLI credentials; connection options such as `base_url` and `timeout` pass through to the
existing client. Context managers and the lower-level `abstract.Client` interface remain supported.

The `abstract.client(...)` factory has existed since 0.2.2. Version 0.3.0 moves the full SDK
into `abstract`, including the lower-level clients and policy types. Publish that version before
advertising the renamed advanced interfaces. `import atoms`, the 0.2 name, still resolves in 0.3
with a `DeprecationWarning`: its top-level names only, `AtomsClient` being `abstract.RobotClient`.

This is all a robot with its own stack needs. The `abstract` command and the robot station are
in `abstract-atoms`, built on it (`apps/atoms`).

```python
import abstract

client = abstract.Client()  # the key: api_key=, else ABSTRACT_API_KEY, else `abstract login`'s file

with client.connect("allenai/molmoact2", "fold the towel") as policy:
    frames = {"overhead": top, "wrist_l": left, "wrist_r": right}  # RGB arrays, or JPEGs
    while not done:
        state = {
            "left_eef_xyz": [x, y, z],  # metres, in the left arm's base frame
            "left_eef_rot6": rot6,  # the rotation matrix's first two columns
            "left_grip": [g],  # 0 closed, 1 open
            "right_eef_xyz": [x, y, z],
            "right_eef_rot6": rot6,
            "right_grip": [g],
        }
        chunk = policy.predict(frames, state)
        # Row k is a pose for t + k * chunk.dt; your arm's inverse kinematics turns each into
        # joint angles. The arm held still while predict() ran, so every row runs; a loop that
        # keeps the arm moving meanwhile skips the rows it ran, as the RobotClient loop below.
        for left, right in zip(chunk.left, chunk.right):
            robot.command(left, right)
        # The next call sends policy.frames_needed frames per camera, oldest first.
        frames = latest_frames(policy.frames_needed)
# Leaving the block ends the episode now; the server would after 60 s idle.
```

A stateful model takes the video since its last observation: after the first call,
send `policy.frames_needed` frames per camera.

### Native robot checkpoints

These interfaces arrived in `abstract-client` 0.2.0.

`client.get_models()` is the availability source; an SDK adapter does not mean a checkpoint
is enabled on the account. These native contracts are separate from the YAM example:

| Model                             | Observation                                                                                                                                                                                                    | Returned commands                                                                                                                                      |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `verne/v0.5`                      | The YAM example's poses and cameras, one frame per camera and then four; not trained on the YAM                                                                                                                | 18 pose rows per arm at 30 Hz                                                                                                                          |
| `runway/praxis-1` | The YAM example's poses and cameras at 16:10, one frame per camera and then 21: one at the end of each row just run. Capture them yourself and call `policy.predict()`; `RobotClient`'s window also counts the pause between chunks. | 21 pose rows per arm at 15 Hz |
| `xiaomi/xiaomi-robotics-1`        | RoboDojo ARX X5 world-frame poses, normalized grippers (0 closed, 1 open), and `left_joint_position` / `right_joint_position` with six measured radians each. Cameras retain `overhead`, `wrist_l`, `wrist_r`. | `chunk.left` / `chunk.right`: 30 end-effector targets at 25 Hz, in the same RoboDojo world frame.                                                      |
| `black-forest-labs/flux-3-action` | DROID Franka `joint_position` (seven radians), `gripper_position` (one closed fraction: 0 open, 1 closed), and cameras `exterior_image_0_left`, `exterior_image_1_left`, `wrist_image_left`.                   | `chunk.joints`: 32 rows of seven absolute joint targets plus gripper at 15 Hz; `chunk.action_space == "joint_position"`. `left` and `right` are empty. |

Use `chunk.row_count` for either command format. `elapsed_rows`, sync/async policies, retries
and the `RobotClient` observation window work with both. Policies sharing one observation
window must use the same state and camera contract. The bimanual station does not drive these native contracts.

### `abstract.RobotClient`: Dream Labs' DreamClient on this API

`abstract.RobotClient` keeps that window for you and paces the requests, with the calls of Dream Labs'
`DreamClient` (Apache-2.0; see `NOTICE`): bind the key, choose the model, push every camera tick,
pull a chunk when it says so.

```python
from concurrent.futures import ThreadPoolExecutor

robot = abstract.RobotClient()  # the key, as abstract.Client finds it
robot.policy({"model": "allenai/molmoact2"})
with robot, ThreadPoolExecutor(1) as worker:  # the request runs while the robot moves
    chunk, row, pending = None, 0, None
    ran = ran_at_ask = 0  # rows the robot has run, and how many when the request went out
    while not done:
        frames = {"video.overhead": top, "video.wrist_l": left, "video.wrist_r": right}
        robot.set_observation(frames, {"prompt": "fold the towel", "state": read_state()})
        rows_left = len(chunk.left) - row if chunk else 0
        if pending is None and robot.refill_due(row, rows_left):
            pending, ran_at_ask = worker.submit(robot.get_action), ran
        if pending is not None and pending.done():
            chunk, pending = pending.result(), None
            # Skip the rows the robot ran while this chunk was computed (at most those already
            # due, chunk.elapsed_rows). A robot that held still meanwhile starts at row 0.
            row = min(chunk.elapsed_rows, ran - ran_at_ask)
        if chunk and row < len(chunk.left):
            robot.command(chunk.left[row], chunk.right[row])
            row, ran = row + 1, ran + 1
        wait_for_next_tick()
```

#### Several models on one robot

DreamClient runs one model. `RobotClient` runs as many as you open on the same camera ticks, each
with its own episode, frames (a stateful model takes several per camera, MolmoAct2 one), pacing and timing.
One drives the arms; the others answer the same observations, to compare them.

```python
robot.policies(
    {"molmo": {"model": "allenai/molmoact2"}, "pi": {"model": "physical-intelligence/pi0.5"}}
)
robot.set_observation(frames, observation)  # one tick, every model
answers = robot.get_actions()  # every model at once: {name: Chunk, or the error it raised}
drive = robot["molmo"]  # one model: get_action(), refill_due(), last, mode, last_timing
```

| DreamClient                                                                         | abstract.RobotClient                                                                                                                   |
| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `DreamClient(api_key)`                                                              | `RobotClient(api_key)`, or `RobotClient(client=...)`                                                                                |
| `get_models()`                                                                      | `get_models()`: served models and your fine-tunes, with their rates                                                                 |
| `policy({"checkpoint": ...})`                                                       | `policy({"model": ...})`; `execution_horizon`, `action_hz`, `sync_above_ms`, `timeout_ms` as in DreamClient                         |
| `set_observation(frames, observation, timestamp=)`                                  | the same: `video.<camera>` frames, `prompt` and `state` (a dict or `state.<name>` keys)                                             |
| `get_action()` returns joint chunks                                                 | `get_action()` returns a `Chunk` in the selected model's action space: poses in `left` / `right`, native joint commands in `joints` |
| `reset_episode()`, `refill_due()`, `close()`                                        | the same                                                                                                                            |
| `mode`, `execution_horizon`, `action_hz`, `last_timing`, `checkpoint`, `session_id` | the same, `model` for `checkpoint`                                                                                                  |
| `obs_window`, `obs_fps`                                                             | none: each answer says how many frames the next observation carries                                                                 |
| `DreamSlowNetworkWarning`                                                           | `abstract.SlowNetworkWarning`                                                                                                          |
| one model per client                                                                | `policies({name: config})`, `get_actions()`, `robot[name]`                                                                          |

### Optional URDF FK and IK (0.3.0)

The solver is not in this package: install `abstract-atoms[ik]` after release, or
`uv pip install -e ./apps/atoms/client -e './apps/atoms[ik]'` from this checkout. Configure each physical arm's URDF, joint order, grasp point and frames:

```python
from abstract_robots.ik import RobotIK

ik = RobotIK.from_file("robot.json")
client = abstract.client(checkpoint="allenai/molmoact2", embodiment="yam", ik=ik)
client.set_joint_observation(frames, measured_joints, grippers, prompt="fold the towel")
chunk = client.get_action()
# Measure again after inference; solving is local and commands no hardware. The arm held still
# during this call; one that kept moving passes start= the rows it ran (at most elapsed_rows).
joints = client.to_joints(chunk, current_measured_joints)
```

See [the configuration and driver guide](../robots/IK.md) for full examples, limits, geometry checks and
validation scope. Different arm geometries/joint counts are supported locally. Model embodiment
checks remain; correct IK does not prove policy transfer. The Python station uses the same solver
through `--ik robot.json`, with `observe_joints()` / `command_joints()` drivers.

DreamClient's seam smoothing (`commanded`) is not implemented. Dataset and fine-tuning commands
and the station's Live View remain in `abstract-atoms`.

`abstract.AsyncClient` is native asyncio with the same arguments, rules and calls
(`await policy.predict(...)`). Cancelling a call cancels its request, but the server may already
be running it, so the next `predict()` asks for that answer first, as after a lost connection.

Connections are HTTPX2's (Pydantic's maintained HTTPX, as the OpenAI and Anthropic SDKs use).
Proxies come from `HTTPS_PROXY` and `NO_PROXY`, and TLS is checked against the operating system's
trust store, so a CA your IT installed works as is. For a private CA, a client certificate or a
proxy in code, configure HTTPX2 and pass it in; the client you pass stays yours to close:

```python
import ssl

import httpx2

tls = ssl.create_default_context(cafile="lab-ca.pem")
tls.load_cert_chain("robot.pem", "robot.key")
client = abstract.Client(http_client=httpx2.Client(verify=tls, proxy="http://proxy.lab:3128"))
```

### Direct sessions and the time profile

```python
with client.connect("allenai/molmoact2", "fold the towel") as policy:
    chunk = policy.predict(frames, state)
    chunk.stages  # this chunk's milliseconds: total, client, network, server and its parts
print(policy.profile)  # the episode: each stage's p50, p95 and max, and what happened on the way
```

Where the API names an engine for a model, an episode's chunks go straight to that engine and
no longer cross the API. There is nothing to set: the API holds a block of chunks on your
account and signs a ticket for it, and each `predict()` posts to the engine under that ticket.
The same `Chunk`, the same errors, an observation resent under its own id and never run or
billed twice. Your one choice stays `transport`:

- `"http"`: HTTPS to the engine's host.
- `"quic"`: the engine's own QUIC socket, which the client reaches by UDP hole punching. An
  episode's first chunk goes over HTTPS; the punch then runs in the background, and the chunks
  that follow travel over QUIC. Where a NAT does not allow the punch (it gives the socket a
  different port for each destination), the client asks the engine for a relay and opens the
  same connection through it: a host both sides can send out to, which passes ciphertext it
  cannot read. Where the engine names no relay, a network blocks UDP, or the connection is
  later lost, the episode keeps to HTTPS without a word. No engine names a relay yet.

What happens on its own:

- The next ticket is asked for in the background while chunks remain, so `predict()` does not
  wait on it.
- An engine that fails twice in a row, or stops answering for 10 s after it has answered, is
  left: the API names the next one and the episode continues there, and when none is left it
  continues through the API. The episode does not move with the session: the next
  `predict()` raises `EpisodeResetError` (`worker_changed`), and the one after begins a new
  episode where the session arrived. See "Episode resets" below.
- A model the API names no engine for runs through the API as ever, and so do your fine-tunes.
  A client asks about a model once, not once an episode. `AsyncClient` always goes through the
  API.

What to know:

- A direct episode's observations and answers are not stored with your account's trajectories.
- The engine's hosts end in `modal.run`: a firewall that allows `api.abstract.inc` alone sends
  the first episode back through the API after about four seconds, and the next ones at once.
- To punch, the client asks two public STUN servers (`stun.cloudflare.com` and
  `stun.l.google.com`) what address its UDP socket is seen at. That request carries nothing
  but the question; the server sees the machine's public address. Two answers that differ mean
  a NAT no punch crosses, and the client goes to the relay without waiting on one.
- A relay sees your machine's public address and the engine's, and the size and timing of
  encrypted datagrams: nothing of an observation or an answer, which only the engine's own
  certificate opens. A relayed connection belongs to the session that asked for it and is
  closed when that session ends; another session of the same client at that engine keeps to
  HTTPS.
- The relay needs no install and no setting: it adds nothing to the wheel but code (the
  0.3.2 wheel is 64.6 kB against 0.3.1's 56.9 kB, about half of that the reset work), and no
  dependency.
- An engine that offers overlays (0.3.5; none in production does yet) is asked for one in
  place of the shared QUIC connection: a connection that is the session's alone, reached by
  the same punch or relay, on which the chunk, each camera frame (one unit of its camera's
  H.264 stream) and the session's telemetry are requests on streams of their own. The chunk's
  body then names its frames instead of carrying them, so an answer never waits behind a
  camera stream that is still crossing, and a resend is a packet, not the observation again.
  A chunk that needs all its frames still waits for all of them: the overlay does not make
  it arrive sooner. Nothing is set for it. Where it cannot be opened, is lost, or a frame
  goes missing on the way, the same observation goes over HTTPS or whole, at once, and the
  episode does not skip or repeat a step.

`policy.profile` is kept for every episode. `client` is the time to build the request, `server`
the engine's from receipt to answer (`decode`, `queue`, `prefill` and `denoise` are its parts,
`queue` counted from receipt), and `network` the rest: both ways, and the API when the chunk
crossed it. `policy.profile.summary()` returns the same as a dict, with which way each chunk
travelled (`paths`: `api` through the API, `https` straight to the engine, `quic_punch` and
`quic_relay` on its QUIC socket, `overlay` on the session's own connection to it; 0.3.1 called
the third `quic`), why a punch failed (`punch_failures`: `timeout`, `port_remap`, `handshake`,
`cert`), what each overlay carried (`overlays`: the way its datagrams went, `punch` or
`relay`, and for each stream the requests sent, the ones that failed and their bytes), and
`events`: a ticket opened or renewed, a QUIC path or an overlay opened or given up for HTTPS
(with the reason), an observation sent `whole` after a frame went missing, a `keyframe`
resend with its cameras, a move to another engine, a return to the API.

`policy.profile.latency()` is what a direct session tells its engine when `close()` ends it
(0.4.2), and the engine passes on to Abstract with the session's last block: for each path
its chunks took, how many and the p50, p90, p99 and max of `total`, `network` and `server`,
and `ready_ms`, how long the episode's first chunk waited on the engine to start, when it
did (a start `wait_ready` waited on before the episode counts too). Figures only, nothing of
an observation or an answer: Abstract reads them by where the robot is and which engine
answered it, to decide where to keep engines warm and where to add them.

### Episode resets (0.3.2)

A model's episode lives on one engine. It can end under a running session: the session moves
to another engine, an engine restarts or loses a copy, the weights behind the model change, or
the session goes quiet for a minute. Before 0.3.2 a model that keeps no memory between chunks
answered the next chunk anyway, from a new episode at step 0, and the client returned its rows
as the old episode's next.

Now a chunk names the episode it continues, and the engine refuses one it does not hold.
`predict()` and `get_action()` raise `abstract.EpisodeResetError`:

```python
try:
    chunk = policy.predict(frames, state)
except abstract.EpisodeResetError as reset:
    log.warning("episode reset: %s", reset.reason)  # worker_changed, episode_lost, ...
    stop_running_the_old_chunk()  # its rows, your IK seed, any filter state: all the old episode's
    chunk = policy.predict(latest_frame_per_camera, state)  # begins the new one, and says so
assert chunk.reset in (None, "episode_start", "worker_changed", ...)  # set on a first chunk
```

- `reset.reason` is one of `abstract.errors.EPISODE_RESETS`: `worker_changed`, `episode_lost`,
  `model_swapped`, `session_resumed` (and `episode_start`, which only a first chunk carries).
- Nothing ran and nothing was billed for the refused observation. It is not sent again: the
  same bytes would be refused again, and running them against a new episode would be wrong.
- The policy has already started over. Its next call sends one frame per camera
  (`policy.frames_needed == 1`), at step 0, under a new observation id, and tells the engine
  it begins an episode and why. `RobotClient` takes that frame from the latest tick.
- `Chunk.episode_id` names the episode a chunk belongs to, and `Chunk.reset` is set on the
  chunk that began it.
- `policy.profile.summary()["resets"]` and `robot[name].resets` count a session's resets by
  reason. A session that resets every few chunks is a fault to report.
- `EpisodeResetError` is a `SessionExpiredError`, so a handler that reconnects still works.

`abstract robot run` says the reset, holds the arms where they are, drops the rows left of the
old chunk, and runs the new episode's first chunk from its first row; with `--ik` that chunk
is solved from the joints measured when it arrives. Its summary counts the resets.

An API or engine older than this names no episode. The client then sends none, and reads a
step conflict back to step 0 as the reset it is.

### Encoding (0.4.0)

This client sends an observation one way: as `application/vnd.abstract.chunk`, each camera's
frames as an H.264 stream and the state as float64 arrays, behind a small JSON header. There
is nothing to set: `Client(encoding=...)` and `ABSTRACT_ENCODING` are removed. A direct
session's engine takes nothing else. The API also takes a JSON request, with each camera's
frames as one MP4 clip of H.264, for callers that cannot send this encoding; this client has
no JSON mode and never falls back to one. A server that does not take the encoding refuses
the request, and the refusal is raised. The answer's rows come back in the same encoding, as the
numbers JSON would carry; a refusal is JSON.

```python
policy.profile.summary()["wire"]  # each chunk's bytes out and back
```

The client pins `Abstract-Version: 2026-11-17`, the first version whose `get_action` takes
only this request. An API from before it refuses that version (`unsupported_api_version`), and
the API refuses a 0.3 client, which pins `2026-10-27` and sends JSON, the same way: upgrade
the client. A resent observation is the same bytes it first went out as.

### Video (0.4.0)

Every camera frame crosses as H.264, one access unit a frame. PyAV, which carries FFmpeg with
libx264, is a dependency of this package (`av>=17,<20`; it has a wheel for every Python this
client supports), and the `video` extra is gone.

```python
frames = {"overhead": top, "wrist_l": left, "wrist_r": right}
chunk = policy.predict(frames, state)
policy.profile.summary()["video"]
# {codec, frames, bytes_per_frame, keyframes, keyframes_asked_for, encode_ms_per_frame, settled}
```

- A frame is an RGB array (height x width x 3, uint8), which goes straight to its camera's
  encoder, or a JPEG (bytes or base64), which is decoded here first. Either way what crosses
  is H.264. A frame larger than 1280x720 is scaled to fit.
- Each camera has its own encoder for each server the episode reaches. An episode's first
  observation says what the client would encode at; every answer says what the streams are
  (the size the model takes, a bitrate, a keyframe interval), and the encoders follow it.
  `Chunk.raw["video"]` is the server's account of the session.
- `Client(video=...)`, or `ABSTRACT_VIDEO`, sets what the streams ask for and nothing else:
  `None` or `"h264"` for the defaults, or a mapping of `bitrate_kbps`, `keyframe_interval`,
  `size` and `encoder`, such as `video={"bitrate_kbps": 300, "size": (640, 360)}`. There is no
  other codec: `video="jpeg"` raises `ConfigError`.

A frame is decoded from the ones before it, and no frame stands in for one the engine could
not decode. Where a camera's stream cannot be decoded whole (a unit whose reference never
arrived, an engine that holds no decoder for the session) the engine refuses the chunk, `409
keyframe_required`: nothing ran and nothing is billed. `predict()` answers that itself, once:
the same frames, under a new observation id, every camera's stream beginning at a keyframe.
A second refusal raises `abstract.KeyframeRequiredError` (a `ConflictError`; `.cameras` names
the streams). An observation abandoned without an answer makes every camera's next frame a
keyframe, unasked.

Three things to know:

- The picture is coarser than a JPEG's: about 32 to 35 dB against the camera at the default
  450 kbps a camera, where a quality-80 JPEG was 40 to 44. No policy has been measured on it,
  so no task quality is claimed for it.
- It costs the robot CPU: about 3 ms a 720p frame a camera in software (`libx264`), 1 ms at
  640x360. Three 720p cameras at 15 Hz measured 1.43 Mbps
  (`apps/atoms/evals/wire/video_bench.py`).
- `RobotClient.set_observation()` keeps each tick until an observation takes it: a camera's
  frames are encoded, as one stream, when `get_action()` picks the ticks it sends, so none
  crosses ahead of its observation.

### Deployments (0.3.4)

A deployment is your own copy of a model, held for your robot until you stop using it: an
episode's worth of a GPU. `client.deployments` manages them, and `connect()` starts an episode
on one:

```python
deployment = client.deployments.create("physical-intelligence/pi0.5", robot="yam", wait=True)
with client.deployments.connect(deployment.id, "fold the towel") as policy:
    chunk = policy.predict(frames, state)
```

`create`, `list`, `get`, `start`, `stop`, `update` (swap the model, same id), `delete`,
`history`, `logs` and `metrics` each call one route, on `Client` and, awaited, on
`AsyncClient`; every read is answered from what the API stored and starts no GPU. An episode
on a deployment runs on `Client` only, and its chunks go to the deployment's own engine and
nowhere else: it does not move to another engine or continue through the API.

A deployment that runs no chunk for its idle timeout (30 minutes unless you set
`idle_timeout=`) releases its GPU. `predict()` then raises `DeploymentNotRunningError`, with the
`state` and the `reason`: call `client.deployments.start(id, wait=True)` and `connect()` again.
The restart is a new attempt and a new episode, never a resume. An episode that outlived a
restart or a model swap raises `EpisodeEndedError` (a `SessionExpiredError`): connect again.

`client.deployments.inspect("hf://<org>/<repo>@<commit>")` says whether a checkpoint on the
Hugging Face Hub can be deployed, without deploying it: the `model` whose lane would run it,
the pinned `checkpoint_uri`, and `problems` when it cannot be served (`servable` is False).
It reads the Hub only, and starts no GPU. Pass what it answered to `create(found.model,
checkpoint=found.checkpoint_uri, checkpoint_options=found.options, ...)` to deploy the
checkpoint on that model's lane, at that model's rates; `update(id, model=..., checkpoint=...)`
swaps it under the same id, a new attempt, and without `checkpoint` returns the deployment to
the model's own weights.

### Transports

`transport` chooses how the calls travel. `"http"` is the default and what everything above
describes. `"quic"` sends the same calls to the same routes over HTTP/3, on one QUIC connection
that every policy on the client shares; it is opt-in and needs the `quic` extra:

```sh
uv add 'abstract-client[quic]'
```

```python
client = abstract.Client(transport="quic")  # or ABSTRACT_TRANSPORT=quic; every client takes it
```

The API sees the same request either way, so chunks are billed the same and a call that gets no
answer is sent again under the same rules. What differs is the network's side:

- QUIC needs outbound UDP to the API on port 443. Where a network blocks it, calls fail with
  `APIConnectionError` or `APITimeoutError`; nothing switches to `"http"` on its own.
- No proxy can carry it. On a machine set to use one (`HTTPS_PROXY`, `ALL_PROXY` or the system's)
  the client raises `ConfigError` rather than go around the proxy, and `http_client=` cannot be
  combined with it.
- TLS is checked against certifi's CA bundle, not the operating system's trust store: a CA your
  IT installed is not trusted, and there is no setting for a private CA or a client certificate.
- A connection that hears nothing for 20 s is closed and the next call opens another. While a
  call waits for its answer the client pings every 5 s, so a model's cold start does not end it.

It runs aioquic's QUIC stack as it comes, with no tuning, and has not been measured against
`"http"`: choose it to compare the two on your own network, not on a promise that it is faster.
`client.transport` says which one a client uses.

`connect(model, task, scaling={"seed": 7})` (or `scaling` in a `RobotClient` config) sends the
API's `scaling` with every observation, so a seedable model replays its noise; the engine's reports
(`scaling`, `cache`, `context`) come back in `chunk.raw`.

Each chunk is billed and can wake a GPU. A call that gets no answer is sent again with the same
bytes and `observation_id`, so the server answers it from its record and never bills it twice.
Refusals the server marks retryable are sent again after its `Retry-After`, up to `max_retries`;
`timeout` bounds a whole call, resends included, and `connect_timeout` opening a connection.

Every error is an `abstract.AbstractError`. A refusal is an `abstract.APIStatusError` subclass named
for its status (`AuthenticationError`, `PaymentRequiredError`, `RateLimitError`, ...) with the
server's `code`, `retryable`, `retry_after` and `request_id`; a refused or answered
`get_action` also carries its reply's `trace_id`, which a replay keeps. `APIConnectionError` and
`APITimeoutError` mean no answer came: the next `predict()` asks for it first. The `abstract.client`
logger reports resends; it never logs the key.

Python 3.10 or later; its dependencies are `httpx2` and PyAV (`aioquic` with the `quic` extra).

Version 0.3 replaces `import atoms` with `import abstract`; the buffered harness is
`abstract.RobotClient` (previously `AtomsClient`). `abstract.client(...)` is the recommended
entry point. The Python station uses this same implementation; there is no separate YAM runner.
