diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 67dd6d0..8aa41ba 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,5 +1,8 @@ blank_issues_enabled: false contact_links: + - name: Questions and community discussion + url: https://github.com/AbyssGG/OpenVINO-Nim-API/discussions + about: Ask usage questions here once Discussions is enabled by the maintainer. - name: Troubleshooting guide url: https://github.com/AbyssGG/OpenVINO-Nim-API/blob/main/docs/troubleshooting.md about: Check the loader and runtime diagnostics before opening an issue. diff --git a/.github/pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE.md similarity index 89% rename from .github/pull_request_template.md rename to .github/PULL_REQUEST_TEMPLATE.md index e7c6c27..2a5760a 100644 --- a/.github/pull_request_template.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -19,7 +19,7 @@ ## Checklist -- [ ] No editor metadata, runtime binaries, model weights or credentials were added. +- [ ] No editor metadata or build artifacts were added. - [ ] No runtime binaries, model weights, credentials or absolute local paths were added. - [ ] New public symbols have ownership, blocking behaviour and exception docs. - [ ] `docs/c-api-coverage.md` or the managed API overview is updated. diff --git a/.github/workflows/docs-pages.yml b/.github/workflows/docs-pages.yml index 198ecad..a494e80 100644 --- a/.github/workflows/docs-pages.yml +++ b/.github/workflows/docs-pages.yml @@ -1,18 +1,18 @@ # SPDX-License-Identifier: Apache-2.0 # -# Manual API documentation publishing. The repository keeps this workflow +# API documentation publishing. The repository keeps this workflow # separate from blocking CI so Pages can be enabled by a maintainer when the # repository settings and deployment environment are ready. name: docs-pages on: + push: + branches: [main] workflow_dispatch: permissions: contents: read - pages: write - id-token: write concurrency: group: pages @@ -21,7 +21,7 @@ concurrency: jobs: build: name: build API pages - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest steps: # actions/checkout v7.0.1 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 @@ -33,7 +33,10 @@ jobs: repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Generate API documentation - run: nimble docs + run: | + nim doc --project --index:on --path:src --outdir:htmldocs src/openvino.nim + nimble docs + cp -R build/docs/. htmldocs/ # actions/configure-pages v6.0.0 - uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d @@ -41,12 +44,15 @@ jobs: # actions/upload-pages-artifact v5.0.0 - uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 with: - path: build/docs + path: htmldocs deploy: name: deploy API pages needs: build - runs-on: ubuntu-24.04 + runs-on: ubuntu-latest + permissions: + pages: write + id-token: write environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 1bf3221..ba06f02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,11 @@ and the OpenVINO runtime baseline evolve independently: ## Unreleased +- Improved onboarding with Git-URL installation, compact inference guidance, + runtime installation links and explicit deployment limitations. +- Added ecosystem announcement and package-index submission drafts. +- Added a Discussions entry point and automatic main-branch API Pages publishing. + - Changed the human-readable project title to `OpenVINO Nim API` while keeping the public repository name `OpenVINO-Nim-API` and release prefix `openvino-nim` unchanged. diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 4e35638..d0886ec 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -27,10 +27,34 @@ considered inappropriate in a professional setting. ## Enforcement Report unacceptable behaviour through the private route in -[SECURITY.md](SECURITY.md) with the subject `Code of Conduct`. The maintainers +[SECURITY.md](SECURITY.md) with the subject `Code of Conduct`. If that route +is unavailable, ask a maintainer for a private contact route without posting +the report or personal information publicly. The maintainers will review a report, protect the reporter's confidentiality where possible, and take the action they consider appropriate, including removing content or restricting participation. +## Scope + +This policy applies in project issues, pull requests, Discussions and other +community spaces, and when someone represents the project publicly. +Maintainers are responsible for explaining and enforcing these standards +fairly, including when a report concerns another maintainer. + +## Enforcement guidelines + +Maintainers consider the impact, context and recurrence of a violation: + +1. **Correction:** explain the harm and request a change in behaviour. +2. **Warning:** set explicit boundaries for continued participation. +3. **Temporary restriction:** suspend participation for a stated period after + serious or repeated violations. +4. **Permanent restriction:** exclude people whose severe or persistent + conduct makes participation unsafe for others. + +Reports are reviewed confidentially where possible. Restrictions and any +conditions for returning should be communicated privately to the person +involved; reporters' identities and private details must not be published. + This policy is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/version/2/1/code_of_conduct/), version 2.1. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8e8d24d..5abd4a3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,6 +6,12 @@ writing code, and [OPENVINO_NIM_0.1_DEVELOPMENT_PLAN.md](OPENVINO_NIM_0.1_DEVELOPMENT_PLAN.md) for the phase-by-phase scope of `0.1.0`. +Please follow our [Code of Conduct](CODE_OF_CONDUCT.md). New to the project? +Documentation corrections, clearer examples and reproducible bug reports are +welcome. Use the issue templates for bugs and feature requests, and +[Discussions](https://github.com/AbyssGG/OpenVINO-Nim-API/discussions) for +questions once the maintainer enables it. Never include private models or secrets. + ## Prerequisites | Component | Requirement | Needed for | @@ -150,6 +156,32 @@ publishing to the Nimble package index all require explicit authorisation from the project owner for that specific action. Nothing in the development plan or in this document grants that authorisation implicitly. +## Maintainer discoverability checklist + +These settings and submissions are manual; merging the repository changes +does not perform them: + +- In Settings → Pages, set **Source = GitHub Actions**. Allow the + `github-pages` environment to deploy from `main`, then run `docs-pages` + once (or push to `main`) and verify its deployment. +- After the site is live, set the repository homepage to + `https://abyssgg.github.io/OpenVINO-Nim-API/`. +- Enable **Discussions** under Settings → General → Features so the question + links in the issue chooser and README work. +- Upload an original **1280 × 640** social preview image under Settings → + General → Social preview. Do not imply Intel endorsement. +- Review `docs/promotion/nimble-packages-entry.json`, check that `openvino` + is available in `nim-lang/packages`, and submit the entry to `packages.json` + following that repository's current contribution rules. Keep Git-URL + installation instructions until the entry is accepted. +- Review and submit the Nim forum, Show HN, r/nim and Chinese drafts in + `docs/promotion/`, and the awesome-list entries where appropriate. Check + platform rules, disclose authorship and avoid duplicate/spam submissions. + Update draft statements about registry and documentation availability + before posting. +- Optionally review repository topics such as `nim`, `nim-lang`, `openvino`, + `inference`, `machine-learning`, `bindings` and `edge-ai`. + ## License Contributions are accepted under Apache-2.0, matching diff --git a/README.md b/README.md index 825035d..1df10b3 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,17 @@ [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE) [![Nim](https://img.shields.io/badge/Nim-%E2%89%A52.0.0-yellow.svg)](https://nim-lang.org/) [![OpenVINO](https://img.shields.io/badge/OpenVINO-2026.4.x-6b4fbb.svg)](https://docs.openvino.ai/) -[![Status](https://img.shields.io/badge/status-v0.1.0-brightgreen.svg)](https://github.com/AbyssGG/OpenVINO-Nim-API/releases/tag/v0.1.0) +[![Latest release](https://img.shields.io/github/v/release/AbyssGG/OpenVINO-Nim-API)](https://github.com/AbyssGG/OpenVINO-Nim-API/releases/latest) **English** | [简体中文](README_zh-CN.md) -Nim bindings for the [OpenVINO](https://docs.openvino.ai/) Runtime C API. +**Run OpenVINO inference from Nim: native binaries, an idiomatic managed API, +and direct access to the Runtime C API.** + +Nim compiles to native code, so your inference application needs no Python +runtime. This makes Nim + OpenVINO useful for small deployments without a +Python application stack—not a promise of a single-file deployment: OpenVINO +libraries, plugins and your model still ship separately. OpenVINO Nim API provides two layers. The managed API is idiomatic Nim with private native handles, Nim exceptions and documented ownership rules. The @@ -38,7 +44,7 @@ made for GPU, NPU or macOS. See [compatibility](docs/compatibility.md) for what was and was not run. Nothing in this README should be read as a claim that a feature already works unless it says so. -## Feature overview +## Features | Capability | 0.1.0 status | Notes | |---|---|---| @@ -57,10 +63,18 @@ before designing an application around a future feature. ## Quick start -1. Install OpenVINO Runtime `2026.4.x`. On Windows, run `setupvars.bat` in +1. Install [Nim](https://nim-lang.org/install.html) `2.0.0` or newer and + [OpenVINO Runtime](#installing-the-openvino-runtime) `2026.4.x`. + On Windows, run `setupvars.bat` in Command Prompt (CMD); on Linux, source `setupvars.sh` in Bash. Keep using - that shell for the remaining commands. -2. Clone this repository and install the local Nim package: + that shell for the remaining commands. macOS is not verified by this project. +2. Install directly from Git (the Nimble registry entry is not published yet): + + ```shell + nimble install https://github.com/AbyssGG/OpenVINO-Nim-API + ``` + +3. For the bundled model and runnable examples, clone the repository: ```shell git clone https://github.com/AbyssGG/OpenVINO-Nim-API.git @@ -68,15 +82,38 @@ before designing an application around a future feature. nimble install ``` -3. Run the verified examples against the included four-value ReLU fixture: +4. Run the verified examples against the included four-value ReLU fixture: ```shell nimble examples ``` -The [getting started guide](docs/getting-started.md) has platform-specific -loader checks and troubleshooting. The complete inference snippet is kept -below and is compiled from the same source as `examples/minimal.nim`. +Here is the managed inference flow, using that fixture from the repository root: + +```nim +import openvino + +proc main() = + let core = newCore() + defer: core.close() + let compiled = core.compileModel("tests/fixtures/relu_1x4_f32.xml", "CPU") + defer: compiled.close() + let request = compiled.createInferRequest() + defer: request.close() + let input = tensorFrom(etF32, initShape(1, 4), [float32(-1.5), 2.0, -0.25, 4.0]) + defer: input.close() + request.setInputTensor(0, input); request.infer() + let output = request.outputTensor(0) + defer: output.close() + echo output.toSeq(float32) +main() +``` + +Expected output: `@[0.0, 2.0, 0.0, 4.0]`. Save it as `quickstart.nim` and run +`nim c -r quickstart.nim` after installing the package. +The [getting started guide](docs/getting-started.md) has loader checks and +troubleshooting. The expanded [minimal example](#minimal-synchronous-inference) +below is checked against `examples/minimal.nim` by the repository's lint task. ## Release artifacts @@ -152,10 +189,26 @@ The package binds to the OpenVINO runtime at run time and never ships it. Install OpenVINO `2026.4.x` separately, then make sure the C API library is visible to the dynamic loader: +Use the [official installation selector](https://www.intel.com/content/www/us/en/developer/tools/openvino-toolkit/download.html) +and [installation documentation](https://docs.openvino.ai/2026/get-started/install-openvino.html) +to obtain the `2026.4` runtime for your OS and architecture. + +| Platform | Installation and activation | +|---|---| +| Linux x86_64 | Extract the official runtime archive; in Bash run `source /path/to/openvino/setupvars.sh` | +| Windows x86_64 | Extract the official runtime archive; in CMD run `call "C:\path\to\openvino\setupvars.bat"` | +| macOS | Use the official distribution for your architecture, if available for `2026.4`; source its `setupvars.sh` and keep the complete library layout. **Experimental: no macOS inference validation here** | + +Python/pip is an optional installation route, not an inference dependency. +For example, `python -m pip install "openvino==2026.4.0"` installs into that +Python environment; configure its library directory as described in +[Getting started](docs/getting-started.md). + | Platform | Library | Loader notes | |---|---|---| | Windows | `openvino_c.dll` | Must be on the DLL search path | | Linux | `libopenvino_c.so`, or `libopenvino_c.so.2640` | Must be on the loader search path. A pip installation ships only the versioned name; both are tried | +| macOS (unverified) | `libopenvino_c.dylib` | Keep dependencies on the loader path; `-d:openvinoLib=/full/path/to/libopenvino_c.dylib` can select the C library explicitly | Loading `openvino_c` alone is not enough to run inference. `Core` also needs `plugins.xml`, the device plugins and the model frontends from the same @@ -171,8 +224,13 @@ commands and pip-specific loader setup. ## Installing the package -The Nimble package index entry is not published yet. Run this command from -the repository root after cloning the checkout: +The Nimble package index entry is not published yet. Install from its Git URL: + +```shell +nimble install https://github.com/AbyssGG/OpenVINO-Nim-API +``` + +Alternatively, run this command from the repository root after cloning: ```shell nimble install @@ -229,7 +287,9 @@ To adapt it to another model, update the input count, element type, shape, data preparation and output validation. The bundled fixture has no weights; an IR model with weights also needs its `.bin` file. -More examples, all using the public API only: +## Examples + +All examples use the public managed API and the bundled, weight-free model: | Example | What it shows | |---|---| @@ -239,6 +299,9 @@ More examples, all using the public API only: | `examples/tensor_basics.nim` | Shapes, element types, and the difference between the safe data paths and the unsafe one | | `examples/profiling.nim` | Per-node timings, and what the numbers do and do not mean | +See the [example guide](examples/README.md) for commands and instructions for +obtaining and adapting another model with OpenVINO conversion tools. + ## Error diagnosis Failures surface as distinguishable Nim exceptions rather than status codes: @@ -280,6 +343,10 @@ Two rules cover most of what you need to know: The [documentation hub](docs/README.md) groups the English guides and the generated API reference. +**[API documentation site](https://abyssgg.github.io/OpenVINO-Nim-API/)** +is published by the Pages workflow once the maintainer enables GitHub Pages. +Until its first deployment, use `nimble docs` locally or the `api-docs` CI artifact. + Start with whichever question you have: | Question | Document | @@ -302,7 +369,17 @@ Project documents: [notice and provenance](NOTICE), [changelog](CHANGELOG.md), [prototype audit](docs/resonance-audit.md). -## Project layout +## Architecture + +`import openvino` exposes the managed layer: private native handles, +idempotent `close()`, Nim exceptions, validated arguments and safe tensor +copies. `import openvino/raw` explicitly opts into header-faithful C ABI +declarations; raw callers are responsible for native lifetimes and status codes. +The managed root never re-exports the raw API. + +See [Architecture](docs/architecture.md) for the design and ownership boundary. + +### Project layout | Path | Purpose | |---|---| @@ -314,7 +391,15 @@ Project documents: [notice and provenance](NOTICE), | `docs/` | Architecture, compatibility, API coverage and decisions | | `.github/workflows/` | Static, runtime, documentation and release checks | -## Community and support +## Roadmap + +After `0.1.0`, priorities include Nim-safe asynchronous callbacks, dynamic-shape +and preprocessing APIs, and verified coverage beyond CPU on Windows/Linux. +These are plans, not supported features or delivery promises. +See the [roadmap](docs/roadmap.md) and discuss concrete use cases before +depending on them. + +## Contributing Bug reports should include the OpenVINO runtime version, Nim version, target device and the smallest reproducible example. Start with @@ -327,6 +412,11 @@ managed/raw boundary intact, and update tests and documentation with any public API change. The project is community maintained and is not an Intel product. +For usage questions and ideas, use +[Discussions](https://github.com/AbyssGG/OpenVINO-Nim-API/discussions) +once enabled by the maintainer. Please follow the +[Code of Conduct](CODE_OF_CONDUCT.md). + ## License Apache-2.0. See [LICENSE](LICENSE), and [NOTICE](NOTICE) for how this package diff --git a/README_zh-CN.md b/README_zh-CN.md index 2a2d712..b708f74 100644 --- a/README_zh-CN.md +++ b/README_zh-CN.md @@ -5,6 +5,9 @@ OpenVINO Runtime C API 的 Nim 绑定。项目主文档以英文维护,本页提供中文 入口和关键说明;API 名称、代码示例和兼容性结论以英文文档为准。 +Nim 编译为原生程序,推理应用不需要 Python 运行时,适合减少部署中的应用栈。 +这不意味着单文件部署:OpenVINO 动态库、插件和模型仍需单独提供。 + **本项目由社区维护,不是 Intel 或 OpenVINO 官方项目,也没有得到 Intel Corporation 的认可或附属关系。** OpenVINO 是 Intel Corporation 的商标。 @@ -46,6 +49,12 @@ GPU、NPU 和 macOS 尚未验证。异步推理、回调、动态形状 API 和 Nimble 索引条目尚未发布,因此目前从仓库安装。安装后的包名和导入名均为 `openvino`,代码中使用 `import openvino`。 +不需要示例和模型文件时,也可以直接从 Git 安装: + +```shell +nimble install https://github.com/AbyssGG/OpenVINO-Nim-API +``` + 示例使用仓库自带的无权重 ReLU 模型,预期输出为 `@[0.0, 2.0, 0.0, 4.0]`。 接入自己的模型时,需要修改输入个数、元素类型、形状、数据准备和结果校验; 仅替换模型路径不足以完成适配。有权重的 IR 模型还需要对应的 `.bin` 文件。 @@ -65,6 +74,7 @@ Nimble 索引条目尚未发布,因此目前从仓库安装。安装后的包 ## 文档入口 +- [生成的 API 文档站](https://abyssgg.github.io/OpenVINO-Nim-API/)(维护者启用 Pages 后可用) - [英文 README](README.md) - [英文入门指南](docs/getting-started.md) - [英文 API overview](docs/api-overview.md) diff --git a/docs/README.md b/docs/README.md index c5c38de..27f49a7 100644 --- a/docs/README.md +++ b/docs/README.md @@ -11,7 +11,7 @@ provides a bilingual entry point. |---|---| | I am new to the project | [Getting started](getting-started.md) | | I need the public types and functions | [API overview](api-overview.md) | -| I need the generated symbol pages | [API index](api-index.html) after `nimble docs` | +| I need the generated symbol pages | [API site](https://abyssgg.github.io/OpenVINO-Nim-API/) once Pages is enabled, or local `build/docs/index.html` after `nimble docs` | | I need to know what really works | [Compatibility](compatibility.md) | | I need to diagnose a loader or runtime failure | [Troubleshooting](troubleshooting.md) | | I need the C binding boundary | [C API coverage](c-api-coverage.md) | @@ -33,11 +33,13 @@ artifact in CI and can also be opened locally at `build/docs/index.html`. ## Optional GitHub Pages deployment -The manual `docs-pages` workflow builds the same output and deploys it to +The `docs-pages` workflow runs `nim doc --project --index:on --outdir:htmldocs` +on the main module (with `--path:src`), then adds the curated public-module +pages and index from `nimble docs`. It deploys the result to GitHub Pages. A maintainer must first enable Pages for GitHub Actions and allow the `github-pages` environment; until then, the normal CI artifact remains the -supported hosted copy. The workflow is deliberately manual so an unopened -Pages setting cannot break the required test workflow. +supported hosted copy. Publishing runs on pushes to `main` or manual dispatch, +separately from required CI. The site documents `main`, not a frozen release. Markdown is checked by `nimble lint`. New documents need one H1 heading, language-tagged fenced blocks, descriptive links and a final newline. diff --git a/docs/getting-started.md b/docs/getting-started.md index 34c0068..d298bde 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -10,6 +10,13 @@ Install OpenVINO from an official distribution. The Nim package loads the C runtime at execution time; it does not bundle the runtime, plugins, frontends, or oneTBB. +Choose `2026.4` for your OS/architecture in the +[official download selector](https://www.intel.com/content/www/us/en/developer/tools/openvino-toolkit/download.html). +Follow the [OpenVINO installation guide](https://docs.openvino.ai/2026/get-started/install-openvino.html) +to extract the runtime archive. Alternatively, install the wheel into a Python +environment with `python -m pip install "openvino==2026.4.0"`; Python is only an +installation/conversion tool, not required by the Nim inference application. + On Windows, open Command Prompt (CMD) and run the official `setupvars.bat`. Replace the path below with your OpenVINO installation directory: @@ -43,6 +50,15 @@ loader path as well. The C library alone is insufficient. `Core` also needs `plugins.xml`, device plugins and model frontends from the same runtime installation. +### macOS (experimental) + +This project has not verified macOS inference. If the official selector offers +`2026.4` for your architecture, extract it and source its `setupvars.sh` in the +same shell. The loader looks for `libopenvino_c.dylib`; an explicit compiler +option `-d:openvinoLib=/full/path/to/libopenvino_c.dylib` selects that library, +but does not configure its dependencies or plugins. Keep the complete official +runtime layout. Do not interpret these instructions as a support claim. + ## 2. Install the package from a checkout ```shell @@ -55,6 +71,14 @@ Version `0.1.0` is released, but its Nimble index entry is not published yet. Run `nimble install` from the checkout to install the package into Nimble's configured package path. The package and import name are both `openvino`. +For application development without a checkout, install directly from Git: + +```shell +nimble install https://github.com/AbyssGG/OpenVINO-Nim-API +``` + +The examples and fixture below still need a checkout. + ## 3. Run the examples The examples use the repository's four-value ReLU fixture, so they do not diff --git a/docs/promotion/awesome-list-entries.md b/docs/promotion/awesome-list-entries.md new file mode 100644 index 0000000..f9d0456 --- /dev/null +++ b/docs/promotion/awesome-list-entries.md @@ -0,0 +1,12 @@ +# Awesome-list submission entries + +## awesome-nim + +- [OpenVINO Nim API](https://github.com/AbyssGG/OpenVINO-Nim-API) — Apache-2.0 OpenVINO Runtime C API bindings for Nim, with managed handles and synchronous inference. + +## awesome-openvino + +- [OpenVINO Nim API](https://github.com/AbyssGG/OpenVINO-Nim-API) — Community Nim bindings to the OpenVINO Runtime C API, with managed and explicit raw layers; CPU verified on Windows/Linux x86_64. + +Check each target list's contribution rules and category before submitting. +These are proposed entries, not claims of inclusion or official endorsement. diff --git a/docs/promotion/nim-forum-post.md b/docs/promotion/nim-forum-post.md new file mode 100644 index 0000000..1c8f607 --- /dev/null +++ b/docs/promotion/nim-forum-post.md @@ -0,0 +1,41 @@ +# Show: OpenVINO Runtime bindings for Nim — v0.1.0 + +I've released [OpenVINO Nim API](https://github.com/AbyssGG/OpenVINO-Nim-API), +a community-maintained, Apache-2.0 binding to the OpenVINO Runtime C API. +It is not an official Intel/OpenVINO project. + +There are two entry points: + +- `import openvino`: managed handles, Nim exceptions, validated shapes, + tensors, model metadata and synchronous inference. +- `import openvino/raw`: explicit, header-faithful C ABI declarations. + +The managed layer also exposes device discovery, properties, per-node +profiling and explicit compiled-model blob export/import. Each handle offers +an idempotent `close()`; borrowed-memory operations are explicitly unsafe. + +Why Nim? Native applications without a Python inference runtime. OpenVINO +libraries, plugins and models are still separate deployment dependencies. +There are no benchmark or single-file deployment claims. + +The current baseline is Nim >= 2.0.0 and OpenVINO 2026.4.x, verified against +2026.4.0 on CPU with Windows/Linux x86_64. GPU, NPU and macOS inference are +not verified. Async callbacks, dynamic-shape APIs and preprocessing are roadmap +items, not features of this release. + +Install from Git while the Nimble registry submission is pending: + +```shell +nimble install https://github.com/AbyssGG/OpenVINO-Nim-API +``` + +Install OpenVINO separately and configure its loader path. The README has +a quick start, and the checkout includes a tiny weight-free ReLU model and +managed examples, so the first inference does not require a model download. + +[Source and quick start](https://github.com/AbyssGG/OpenVINO-Nim-API) · +[v0.1.0 release](https://github.com/AbyssGG/OpenVINO-Nim-API/releases/tag/v0.1.0) + +I'd welcome feedback on the Nim API, ownership ergonomics and documentation. +Reproducible reports and small example/documentation improvements are useful +contributions. What would you want from an OpenVINO binding for Nim? diff --git a/docs/promotion/nimble-packages-entry.json b/docs/promotion/nimble-packages-entry.json new file mode 100644 index 0000000..bf22174 --- /dev/null +++ b/docs/promotion/nimble-packages-entry.json @@ -0,0 +1,9 @@ +{ + "name": "openvino", + "url": "https://github.com/AbyssGG/OpenVINO-Nim-API", + "method": "git", + "tags": ["openvino", "inference", "machine-learning", "bindings"], + "description": "Nim bindings for the OpenVINO Runtime C API, with managed handles and synchronous inference", + "license": "Apache-2.0", + "web": "https://github.com/AbyssGG/OpenVINO-Nim-API" +} diff --git a/docs/promotion/reddit-post.md b/docs/promotion/reddit-post.md new file mode 100644 index 0000000..d41974e --- /dev/null +++ b/docs/promotion/reddit-post.md @@ -0,0 +1,27 @@ +# r/nim: OpenVINO Runtime bindings for Nim — v0.1.0 + +I've released [OpenVINO Nim API](https://github.com/AbyssGG/OpenVINO-Nim-API), +an Apache-2.0 community project with an idiomatic managed layer +(`import openvino`) and a separate raw C ABI layer (`import openvino/raw`). +It is not official or affiliated with Intel/OpenVINO. + +The managed API covers synchronous inference, model metadata, tensors, +properties, device discovery, profiling and explicit compiled-model blob I/O. +Native handles have idempotent `close()` methods and a destructor backstop. + +Nim lets the inference application run without Python, although OpenVINO +libraries/plugins and models are still required. The current baseline is +Nim >= 2.0.0 and OpenVINO 2026.4.x, verified against 2026.4.0 on CPU with +Windows/Linux x86_64. GPU, NPU and macOS are unverified; async callbacks, +dynamic-shape APIs and preprocessing are planned, not implemented. + +```shell +nimble install https://github.com/AbyssGG/OpenVINO-Nim-API +``` + +That is a Git install: the Nimble registry entry is not published yet. +Configure OpenVINO separately using the README instructions. +The checkout has managed examples and a tiny weight-free ReLU model. + +I'd welcome Nim-specific feedback on ownership, errors, documentation and +example use cases. [Release](https://github.com/AbyssGG/OpenVINO-Nim-API/releases/tag/v0.1.0). diff --git a/docs/promotion/show-hn.md b/docs/promotion/show-hn.md new file mode 100644 index 0000000..aa7c046 --- /dev/null +++ b/docs/promotion/show-hn.md @@ -0,0 +1,24 @@ +# Show HN: OpenVINO Runtime bindings for Nim + +Submission URL: https://github.com/AbyssGG/OpenVINO-Nim-API + +## Suggested first comment + +I made OpenVINO Nim API, a community binding to the OpenVINO Runtime C API. +v0.1.0 provides both idiomatic Nim handles with explicit lifetime management +and a separate header-faithful raw layer. It is Apache-2.0 and not an official +Intel/OpenVINO project. + +The idea is to run inference in native Nim applications without a Python +runtime. It still requires the OpenVINO runtime, plugins and model files; +this is not a standalone single-file distribution. + +Implemented: synchronous inference, model metadata, tensors, device discovery, +properties, profiling and explicit compiled-model blob I/O. The supported +baseline is Nim >= 2.0.0 and OpenVINO 2026.4.x, with CPU verification on +Windows/Linux x86_64 against 2026.4.0. No GPU/NPU/macOS inference or performance +claims yet. Async callbacks and preprocessing are future work. + +The README includes installation and a managed inference example using a +bundled weight-free ReLU fixture. I'd appreciate feedback on API ergonomics +and where this could be useful in small native deployments. diff --git a/docs/promotion/zh-post.md b/docs/promotion/zh-post.md new file mode 100644 index 0000000..b791a8c --- /dev/null +++ b/docs/promotion/zh-post.md @@ -0,0 +1,43 @@ +# 自荐:OpenVINO Nim API v0.1.0,用 Nim 调用 OpenVINO Runtime + +我发布了 [OpenVINO Nim API](https://github.com/AbyssGG/OpenVINO-Nim-API) +的 v0.1.0:基于 Apache-2.0 许可证的 OpenVINO Runtime C API Nim 绑定。 +这是社区项目,不是 Intel / OpenVINO 官方项目,也没有官方背书。 + +项目提供两层接口: + +- `import openvino`:Nim 风格的托管句柄、异常、形状校验和张量操作; +- `import openvino/raw`:显式导入、忠实于 C 头文件的原始 ABI 声明。 + +目前实现了同步推理、模型元信息、设备发现、属性配置、节点 profiling, +以及编译模型 blob 的显式导入/导出。句柄提供幂等的 `close()`, +析构作为兜底;借用调用者内存的接口明确标为 unsafe。 + +为什么选择 Nim?它编译为原生程序,推理应用无需 Python 运行时, +可以减少小型部署中的应用栈。不过仍需 OpenVINO 动态库、插件和模型文件, +不是“单文件部署”,也没有尚未测量的性能或体积数据。 + +当前要求 Nim >= 2.0.0、OpenVINO 2026.4.x,已经在 Windows/Linux x86_64 +上使用 2026.4.0 验证 CPU 推理。GPU、NPU、macOS 尚未验证; +异步回调、动态形状 API 和预处理仍在路线图中。 + +Nimble 索引尚未提交,可直接从 Git 安装: + +```shell +nimble install https://github.com/AbyssGG/OpenVINO-Nim-API +``` + +OpenVINO 运行时需单独安装并配置加载路径。README 提供快速开始, +仓库包含无需下载的无权重 ReLU 模型及托管层示例。 +图片解码、归一化和结果解释由应用负责,不是现成的图像分类工具。 + +欢迎反馈 API 使用体验、文档问题和可复现的错误。 + +- 仓库:https://github.com/AbyssGG/OpenVINO-Nim-API +- 发布:https://github.com/AbyssGG/OpenVINO-Nim-API/releases/tag/v0.1.0 + +## 发布前提示(不作为正文) + +V2EX 可按节点规则发布到“分享创造”;掘金可补充实际复现的操作步骤; +HelloGitHub 自荐可将以上项目简介填入其当前模板。发布前检查各平台规则, +不要批量重复投放,也不要加入没有实测的性能数字。 diff --git a/examples/README.md b/examples/README.md index 426a3bd..6ada879 100644 --- a/examples/README.md +++ b/examples/README.md @@ -30,6 +30,33 @@ model, update the input count, element types, shapes, data preparation and output validation. The fixture has no weights; an IR model with weights also needs its `.bin` file. +## Obtaining another model + +The bundled fixture is the best first test: no download or conversion is +needed. For your own ONNX model, use OpenVINO's offline conversion tools in a +separate Python environment with `openvino==2026.4.0` installed: + +```shell +ovc /path/to/model.onnx --output_model /path/to/converted/model.xml +``` + +See [OpenVINO model conversion](https://docs.openvino.ai/2026/openvino-workflow/model-preparation.html) +for supported source formats and conversion options. Keep the generated XML +and BIN together. Python is needed for this preparation step, not for the Nim +inference application. + +To find a public example model, browse +[Open Model Zoo](https://github.com/openvinotoolkit/open_model_zoo) and follow +the chosen model's download/conversion instructions. Check its license, +input layout, normalization, output meaning and compatibility with your +OpenVINO version before use; no Zoo model is tested by this repository. + +For image classification, prepare the required image tensor in application +code and interpret the output scores using that model's labels. The bindings +do not include image decoding, resizing, normalization, a classification +pipeline or model downloading. Do not run the ReLU example unchanged against +a classification model. + Use [Getting started](../docs/getting-started.md) for loader setup and [the API overview](../docs/api-overview.md) for the ownership rules that the examples intentionally make visible.