inferd-client
Rust client for the inferd local-inference daemon.
NDJSON-over-IPC. Wire protocol frozen as v1; full spec at
docs/protocol-v1.md
in the upstream repo.
Quickstart
use ;
use StreamExt;
async
Transports
| Constructor | Platform |
|---|---|
Client::dial_tcp("127.0.0.1:47321") |
All |
Client::dial_uds(&path) |
Unix |
Client::dial_pipe(r"\\.\pipe\inferd-infer") |
Windows |
Wait-for-ready
Two patterns from the upstream docs/protocol-v1.md §"Client
connection lifecycle":
- Pattern A — passive:
dial_and_wait_ready(timeout, dial_fn). Retries connect with exponential backoff (100ms → 5s cap) for transient errors during daemon bring-up. Permanent errors (permission denied, malformed addr) bubble up immediately. Recommended for inference-only consumers. - Pattern B — active:
AdminClientsubscribes to the admin socket and yields lifecycle events (starting/loading_model/ready/restarting/draining). Use this for installer GUIs, dashboards, or middleware that wants progress UX during first-boot model download.
Versioning
Pinned to the same major/minor as inferd-proto (this crate
re-exports the wire types). Cargo's lock-file is the version-pin
contract:
[]
= "0.1"
inferd-client 0.1 always uses inferd-proto 0.1 and talks to
inferd-daemon 0.1. Upstream protocol-v1 changes are
backwards-additive only; breaking changes go to v2 on a separate
socket.
Compatibility
End-to-end tested against the live inferd-daemon binary:
crates/inferd-daemon/tests/echo.rs.
The Go sibling client at clients/go/ follows the same wire
contract.
License
MIT. See LICENSE.
Contributing
Bug reports, design discussions, and PRs welcome at
github.com/3rg0n/inferd. Read
CONTRIBUTING.md in the upstream repo before opening a PR.