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.
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 can export events to the Xybrid Platform.
Configuration
use ;
// From environment variables (recommended)
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.