Skip to content

shota3506/onnxruntime-purego

Repository files navigation

onnxruntime-purego

Go Reference

Pure Go bindings for ONNX Runtime using ebitengine/purego.

This library provides a pure Go interface to ONNX Runtime without requiring cgo, enabling cross-platform machine learning inference in Go applications.

NOTE: This project is currently unstable. APIs may change without notice.

Supported Versions

Library Supported Version
ONNX Runtime 1.23.x
ONNX Runtime GenAI 0.11.x

ONNX Runtime GenAI Support

This library also includes experimental support for ONNX Runtime GenAI, enabling text generation with large language models. See examples/ for usage examples.

Prerequisites

You need to have the ONNX Runtime shared library installed on your system:

  • macOS: libonnxruntime.dylib
  • Linux: libonnxruntime.so
  • Windows: onnxruntime.dll

Download the appropriate library from the ONNX Runtime releases.

The library will be automatically discovered if placed in standard system locations:

  • macOS: /usr/local/lib, /opt/homebrew/lib, /usr/lib
  • Linux: /usr/local/lib, /usr/lib, /lib
  • Windows: Standard DLL search paths

Alternatively, you can specify a custom path when creating the runtime.

Installation

go get github.com/shota3506/onnxruntime-purego

Examples

See the examples/ directory for complete usage examples.

About

A Pure Go binding for ONNX Runtime using ebitengine/purego

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published