vifu-runtime
vifu-runtime is the small, stateful execution kernel at the center of Vifu.
Rust applications use this crate to embed Vifu directly in their process. The
separate vifu package installs the complete Server and Agent Gateway
application.
The crate uses Bevy App and ECS primitives without the renderer, windowing
stack, database, HTTP server, or Vifu Console. It also provides the higher-level
VifuRuntime API used by applications and Vifu Server.
Add the runtime
[]
= "0.1"
Register providers, agents, and endpoints
use Arc;
use *;
let mut provider = new?;
provider.add_route?;
let runtime = new?;
runtime.register_provider?;
runtime.register_agent?;
runtime.register_endpoint?;
let output = runtime
.invoke
.await?;
Providers implement AgentProvider and are registered dynamically, so an
application can connect an in-process agent, an HTTP model service, or its own
transport without changing Cargo features. MemoryRuntimeStore is the default.
Pass a host RuntimeStore to VifuRuntime::with_store for durable sessions, or
use project snapshot export and restore.
start_invoke, poll_invocation, and cancel_invocation provide the same
result contract to synchronous game loops. The lower-level HeadlessRuntime
remains available for Bevy plugins, command/event processing, and custom
effects.
Vifu Server reuses this invocation model and adds multi-project HTTP APIs, access control, database persistence, and traces. Agent Gateway is an optional Server transport for providers running on another machine.