Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Xybrid SDK
Developer-facing API for hybrid cloud-edge AI inference with declarative routing annotations.
Overview
The Xybrid SDK provides high-level abstractions and macros for building hybrid inference pipelines. It allows developers to annotate functions with #[hybrid::route] to enable automatic orchestrator-based routing between local and cloud execution.
Initialization
Configure the SDK in one call with the init() builder. Inference runs
on-device whether or not you authenticate; passing an API key starts the
platform telemetry exporter so your runs show up on the dashboard.
// Anonymous — local inference, telemetry disabled
init.run;
// Authenticated — telemetry exporter starts automatically
init
.api_key
.run;
Without a key, the first inference logs a one-shot hint pointing at the
dashboard (suppress with XYBRID_QUIET=1). Get a free key at
https://dashboard.xybrid.dev. The builder also takes .cache_dir(...),
.gateway_url(...), .ingest_url(...) (self-hosted dashboards), and
.resource_telemetry(...).
Usage
Basic Example
use hybrid;
Using Common Types
use *;
// Use orchestrator directly
let mut orchestrator = new;
let envelope = Envelope ;
// ...
Macro Status
The #[hybrid::route] macro is currently a placeholder. It:
- ✅ Compiles and can be used on functions
- ✅ Preserves the function signature and behavior
- ⏳ Does not yet transform functions to use the orchestrator
Future Implementation
Future versions of the macro will:
- Extract function metadata (name, parameters, return type)
- Generate orchestrator calls automatically
- Wrap function body with
orchestrator.execute_stage()calls - Handle input/output envelope conversion
- Inject
DeviceMetricsandLocalAvailabilityhandling
Project Structure
xybrid-sdk: Main SDK crate that re-exportsxybrid-coreand provides the macroxybrid-macros: Procedural macro crate implementing#[hybrid::route]
Telemetry
The SDK includes built-in telemetry that exports events to the Xybrid Platform.
For the common case you don't need anything here — just pass .api_key(...) to
init() and the exporter starts with sensible defaults
(production ingest URL, batching, retry). The APIs below are the advanced
path for callers that need explicit control over batching, device context, or
the exporter lifecycle.
Advanced configuration
use ;
// From environment variables
let exporter = from_env?;
// Manual configuration
let config = new
.with_batch_size
.with_flush_interval;
let exporter = new;
Device context
Telemetry auto-detects chip family, RAM, OS and kernel versions, CPU architecture, and execution provider hints by default.
use ;
let config = new
.with_app_version
.with_device_label
.with_hardware_chip;
let exporter = new;
See telemetry.md for full privacy posture, opt-out, and wire format.
Environment Variables
| Variable | Description | Default |
|---|---|---|
XYBRID_INGEST_URL |
Telemetry ingest endpoint | https://ingest.xybrid.dev |
XYBRID_API_KEY |
API key for authentication | (required) |
XYBRID_PLATFORM_URL |
Legacy fallback URL | - |
Features
- Circuit breaker: Prevents hammering failing endpoints
- Automatic retry: Exponential backoff with jitter
- Batching: Configurable batch size and flush interval
- Background queue: Retries failed events automatically
Examples
See examples/macro_demo.rs for a complete example of using the macro.