Skip to main content

Additional examples

The Modelverse examples are standalone find_package(Modelverse CONFIG) projects on the public API only, one shared README.md walk-through beside them, and together they cover the library surface the tutorial meets through the clikart-cli executable. They live in the release's examples archive, ClikaRT-<version>-examples.tar.xz (Get ClikaRT names the download), under cpp/modelverse/; the release archive's own examples/src carries the runtime's examples (the ClikaRT catalog). Building them needs the release archive for your platform, extracted, with CLIKART_BUNDLE_DIR naming its directory: the one cmake/ directory there carries both products' packages.

Read top to bottom; each row assumes a little of the ones above it.

ExampleWhat it shows
init_modelThe registered catalog and identity resolution: list the families, resolve a model's identity from a local directory or a Hugging Face Hub repo id. The snapshot fetches configs and companions only, so identity costs no weight download.
00_generateThe minimal end-to-end path: explicit snapshot, registry match, generative pipeline, one prompt, text. The program part 4 of the tutorial builds.
01_serveThe ServeAPI in process: implement the ChatEngine interface, mount it on ServeApi, and round-trip one /v1/chat/completions request through the built-in HTTP client. Runs with no arguments and no checkpoint, so it is also the fastest server smoke test.
02_custom_nodeYour own ClikaRT::runtime::Model node composed with the library's serving nodes in one pipeline: a synthesized two-layer llama generates and a short custom node post-processes the reply, with the request surface unchanged. Offline, runs with no arguments. The worked version against a real model is Add your own node to a model pipeline.
03_conversational_pipelineA conversational AI as one pipeline: wav bytes in, the reply waveform out, through speech to text, the chat template, a chat model and text to speech across eight nodes; real models, so it fetches on first run and takes a question wav plus the voice-reference wav the speech model requires. The guide is A conversational AI as one pipeline.
04_classify_zero_shotZero-shot image classification: the labels you name scored against a picture by cosine in a dual-tower checkpoint's shared space (SigLIP); the picture drawn by the program; no arguments.
05_detect_objectsObject detection over the checkpoint's own label set (DETR): boxes in the picture's pixels above a confidence; no arguments.
06_detect_by_phraseOpen-vocabulary detection (OWL-ViT): the prompt's phrases encoded once, a box per thing found, labeled with its phrase; no arguments.
07_estimate_depthMonocular depth (Depth Anything V2): one value per pixel at the picture's size, metric or relative; no arguments.
08_read_textText recognition (GLM-OCR): a page of block letters drawn with the operators, read back as text through the registry's text-recognition door; no arguments.
09_rerankReranking (Qwen3-Reranker): one relevance score per document against a query, printed best first; no arguments.
10_describe_a_pictureVision-language chat (Qwen3-VL): one question about a picture, the picture riding the user turn; greedy, no arguments.

A program that runs with no arguments and prints the same text on every run sits beside its recorded output (<name>.out), the text the release printed; a program that takes a checkpoint or a clip, or prints a port, is built and not recorded.

Build and run​

From the extracted examples/ directory:

cmake -S cpp/modelverse -B build-examples \
-DModelverse_DIR="$CLIKART_BUNDLE_DIR/cmake"
cmake --build build-examples
build-examples/init_model # catalog only, offline
build-examples/init_model -r openai/whisper-large-v3-turbo # + identity from Hugging Face
build-examples/00_generate Qwen/Qwen2.5-0.5B-Instruct "Once upon a time, in a port town by a cold sea,"
build-examples/01_serve
build-examples/02_custom_node # offline, no arguments
build-examples/05_detect_objects # the vision, OCR, reranking and chat programs: no arguments, the checkpoint from the local cache

01_serve prints its bound port, answers one request against itself, and exits PASS, which makes it the one to run first when checking a new machine:

serving on 127.0.0.1:41627
HTTP 200
choice: echo: Say hello.
01_serve: PASS

Every program runs compute, so it needs the license credential in CLIKA_RT_LICENSE or in the per-user file clikart-license-init writes; without one a call is refused with the code name LICENSE_FAILED. Where models come from, cache placement and the offline path are the same for the examples as for clikart-cli; the examples' shared README.md restates them next to the code.