Xybrid

Quick Start

Get up and running with Xybrid in minutes

Get Xybrid running in your app with a few lines of code. Choose your SDK below.

Install

# pubspec.yaml
dependencies:
  xybrid_flutter: ^0.5.0
flutter pub get

Run inference

import 'package:xybrid_flutter/xybrid_flutter.dart';

// Runs locally as-is. Add a free key from dashboard.xybrid.dev to see
// your inference traces: Xybrid.init(apiKey: '...')
await Xybrid.init();

// Load a model and run text-to-speech
final model = await Xybrid.model('kokoro-82m').load();
final result = await model.run(
  XybridEnvelope.text("Hello from Xybrid!"),
);

// result.audioBytes contains the generated speech audio

Expected output: Audio bytes containing synthesized speech.

Install

Add via Swift Package Manager in Xcode:

File > Add Package Dependencies and enter:

https://github.com/xybrid-ai/xybrid

Or add to Package.swift:

dependencies: [
    .package(url: "https://github.com/xybrid-ai/xybrid", from: "0.5.0")
]

Run inference

import Xybrid

// Runs locally as-is. Add a free key from dashboard.xybrid.dev to see
// your inference traces: Xybrid.initialize(apiKey: "...")
Xybrid.initialize()

// Describe, then explicitly load a model from the registry
let model = try await Xybrid.model("kokoro-82m").load()

// Run text-to-speech
let envelope = Envelope.text("Hello from Xybrid!")
let result = try await model.runAsync(envelope: envelope)

// result.audioBytes contains the generated speech audio

Expected output: result.success == true with audio bytes in result.audioBytes.

Install

// build.gradle.kts
dependencies {
    implementation("ai.xybrid:xybrid-kotlin:0.5.0")
}

Run inference

import ai.xybrid.*

// Runs locally as-is. Add a free key from dashboard.xybrid.dev to see
// your inference traces: Xybrid.init(context, apiKey = "...")
Xybrid.init(context)

// Describe, then explicitly load a model from the registry
val model = Xybrid.model("kokoro-82m").load()

// Run text-to-speech
val envelope = Envelope.text("Hello from Xybrid!")
val result = model.runAsync(envelope)

// result.audioBytes contains the generated speech audio

Expected output: result.success == true with audio bytes in result.audioBytes.

Install

In Unity, go to Window > Package Manager > + > Add package from git URL and enter:

https://github.com/xybrid-ai/xybrid.git?path=/bindings/unity

Or via OpenUPM: openupm add ai.xybrid.sdk. Native libraries download automatically on first import (SHA-256 verified); pin a version by appending #v0.5.0 to the git URL.

Run inference

using Xybrid;
using UnityEngine;

// Runs locally as-is. Add a free key from dashboard.xybrid.dev to see
// your inference traces: XybridClient.Initialize(apiKey: "...")
XybridClient.Initialize();

// Load a TTS model and generate NPC dialogue
using var model = XybridClient.LoadModel("kokoro-82m");
using var result = model.Run(Envelope.Text("Welcome, traveler. The road ahead is dangerous."));

result.ThrowIfFailed();
Debug.Log($"Output: {result.Text}");
Debug.Log($"Latency: {result.LatencyMs}ms");

Expected output: result.Success == true with audio output from the TTS model.

Install

@xybrid/web is a private preview and not yet on npm. It lives in bindings/web:

git clone https://github.com/xybrid-ai/xybrid
cd xybrid/bindings/web
pnpm install
pnpm dev:example   # downloads pinned demo models, then serves the demo

Run inference

import { XybridLlm } from "@xybrid/web";

// Stream a reply from a language model running in the browser
const llm = await XybridLlm.load("/llm/model_metadata.json", {
  wasmPath: "/llm-runtime",
  accelerator: "auto", // WebGPU when available, wasm otherwise
});

for await (const delta of llm.generateStream("Hello from Xybrid!")) {
  output.append(delta);
}

Models can also load straight from Hugging Face — the SDK lists the repo, verifies the download with SHA-256 when Hugging Face provides a Git-LFS OID (the normal case for model files), or by size for non-LFS files, and synthesizes compatible metadata in memory when the repo doesn't ship one:

const llm = await XybridLlm.fromHuggingFace("litert-community/SmolLM2-135M-Instruct", {
  wasmPath: "/llm-runtime", // defaults to /xybrid/llm-runtime when omitted
});

Expected output: Text streamed into the page token by token, generated entirely in the browser.

See the Web SDK guide for the tensor surface, registry loading, and the full API.

Install

# Cargo.toml
[dependencies]
xybrid = "0.5.0"

Run inference

use xybrid::ModelLoader;
use xybrid::ir::{Envelope, EnvelopeKind};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Load a model from the registry
    let model = ModelLoader::from_registry("kokoro-82m").load()?;

    // Run text-to-speech
    let input = Envelope::new(EnvelopeKind::Text("Hello from Xybrid!".into()));
    let result = model.run(&input, None)?;

    // result contains the generated speech audio
    Ok(())
}

LLM models need the llama.cpp backend — enable it with features = ["llm-llamacpp"].

Expected output: A result envelope containing synthesized speech audio.

Install

# macOS / Linux
curl -sSL https://raw.githubusercontent.com/xybrid-ai/xybrid/master/install.sh | sh
# Windows (PowerShell)
irm https://raw.githubusercontent.com/xybrid-ai/xybrid/master/install.ps1 | iex

See the CLI guide for pre-built binaries and building from source.

Run inference

# List available models
xybrid models list

# Run text-to-speech
xybrid run --model kokoro-82m --input-text "Hello from Xybrid!" --output hello.wav

# Run speech-to-text
xybrid run --model whisper-tiny-ggml --input-audio recording.wav

Expected output:

Transcription: "Hello, how can I help you?"

Next Steps

On this page