Overview
The RCLI engine follows a simple lifecycle: create → initialize → use → destroy.rcli_create
Create a RCLI engine instance.Optional JSON configuration string. Pass
NULL for defaults.Supported keys:system_prompt(string): Custom LLM system promptgpu_layers(int): GPU layer count overridectx_size(int): LLM context window size
Opaque handle to the engine instance, or
NULL on failure (out of memory).Example
rcli_create() allocates memory but does not load models. Call rcli_init() to complete initialization.rcli_init
Initialize all engines (STT, LLM, TTS, VAD, Actions).Engine handle from
rcli_create()Path to directory containing model files. Must include:
zipformer/(streaming STT)whisper-base.en/orparakeet-tdt-*(offline STT)- LLM GGUF file (e.g.,
qwen3-0.6b-q4_k_m.gguf) piper-voice/orkokoro/(TTS)silero_vad.onnxespeak-ng-data/
Number of LLM layers to offload to GPU:
99: All layers (recommended for Apple Silicon)0: CPU-only mode1-50: Partial GPU offload
0: Success- Non-zero: Initialization failed (missing models, invalid paths, etc.)
Example
Model Detection
The engine automatically selects models based on priority:- LLM: Scans for GGUF files, selects highest-priority model (Qwen3 > LFM2 > others)
- STT: Prefers Parakeet TDT (high-accuracy) over Whisper if available
- TTS: Selects best available voice (Kokoro > KittenTTS > Piper)
~/.rcli/config.json.
rcli_is_ready
Check if the engine is initialized and ready to use.Engine handle
1: Engine is initialized0: Not initialized or invalid handle
Example
rcli_destroy
Destroy the engine and free all resources.Engine handle to destroy. Safe to pass
NULL.Example
Complete Example
Error Handling
See Also
- Voice Pipeline - Start listening and processing
- State Management - Query engine state
- Callbacks - Register event handlers