vifu-runtime
vifu-runtime is the small, stateful execution kernel at the center of Vifu.
Most applications should depend on the vifu crate, which includes Runtime
support by default. This lower-level crate remains available for hosts that only
need the kernel implementation.
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.
Use the public Vifu SDK
[]
= "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.