Resonance is a Nim wrapper and binding library for the OpenVINO C API.
It is a standalone library focused on:
- low-level OpenVINO C API bindings
- safe Nim ownership wrappers
- tensor and infer request helpers
- compiled-model import/export
- Intel NPU-oriented runtime helpers
- Windows x64 variadic ABI compatibility for profiling properties
Resonance is a library, not an end-user application. It does not ship TTS pipelines, GUI code, or model-specific business logic.
- Pure Nim runtime integration with
openvino_c.dll - No Python runtime dependency
- Thin enough to stay close to OpenVINO
- High-level enough to avoid raw pointer ownership bugs
- Designed around real Intel NPU deployment constraints
Nim App
-> resonance/core
-> resonance/model
-> resonance/compiled_model
-> resonance/infer_request
-> resonance/tensor
-> resonance/c_api
-> openvino_c.dll
OvStatusOvElementTypeOvShapeOvProfilingInfoov_*C function importsnv_compile_model_with_perf_countnv_enable_perf_count
newCore()getAvailableDevices()readModel()compileModel()compileModelWithProfiling()importModel()compileOrImportModel()createInferRequest()setInputTensor()getOutputTensor()infer()getProfilingInfo()newTensor()setShape()getShape()getData()getSize()
- Stay close to the OpenVINO C API.
- Make ownership explicit and automatic with Nim destructors.
- Treat compiled-model blob caching as core infrastructure.
- Keep Intel NPU workflows first-class.
- Separate reusable inference plumbing from application logic.
src/
resonance.nim
resonance/
c_api.nim
core.nim
model.nim
compiled_model.nim
infer_request.nim
tensor.nim
errors.nim
perf_count_wrapper.c
examples/
basic_infer.nim
- Install Nim 2.x.
- Prepare the OpenVINO Runtime and ensure
openvino_c.dllis available at runtime. - Build and run the example from the repository root:
nimble demoMinimal usage:
import resonance
let core = newCore()
echo core.getAvailableDevices()The bundled example also demonstrates compileOrImportModel(), which is the recommended path when you want predictable NPU cold-start behavior with .blob cache reuse.
Resonance should contain:
- OpenVINO bindings
- safe wrappers
- error handling
- profiling helpers
- blob cache helpers
- reusable examples
Resonance should not contain:
- TTS pipeline logic
- tokenizer logic
- model-specific post-processing
- GUI code
- application CLI behavior
This project was developed with the assistance of Google Gemini 3.1 Pro.
AI was used as a development assistant for tasks such as code generation, debugging, documentation, API exploration, and development workflow support.
The project architecture, technical direction, integration decisions, testing, hardware validation, and final code review were performed by the project author.
AI assistance does not change the project's core technical implementation or its open-source licensing.
This project is licensed under the Apache License 2.0.