Add Go implementation with ONNX Runtime

- Use golang:1.23-bookworm as builder
- Use debian:bookworm-slim as runtime
- Use github.com/yalue/onnxruntime_go for ONNX inference
- Use github.com/sugarme/tokenizer for tokenization
- Download ONNX Runtime v1.27.0 shared library
- Download model.onnx and model.onnx_data from onnx-community
- Support API_SECRET environment variable for authentication
- Final image size: ~266 MB

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Christoph Haas 2026-06-28 12:35:31 +02:00
parent 6101df3bfe
commit 21d467a284
4 changed files with 303 additions and 19 deletions

17
go.mod Normal file
View file

@ -0,0 +1,17 @@
module vector
go 1.23
require (
github.com/sugarme/tokenizer v0.3.0
github.com/yalue/onnxruntime_go v1.31.0
)
require (
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/schollz/progressbar/v2 v2.15.0 // indirect
github.com/sugarme/regexpset v0.0.0-20200920021344-4d4ec8eaf93c // indirect
golang.org/x/text v0.25.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)