Skip to content

Instantly share code, notes, and snippets.

@peterc
Created April 18, 2026 12:52
Show Gist options
  • Select an option

  • Save peterc/bb77a9d3eed9f52577439ba5fb01edea to your computer and use it in GitHub Desktop.

Select an option

Save peterc/bb77a9d3eed9f52577439ba5fb01edea to your computer and use it in GitHub Desktop.
Create an embedding from Ruby using a good small model, quickly on CPU only.
require "informers"
MODEL = "Snowflake/snowflake-arctic-embed-s"
embedder = Informers.pipeline(
"embedding",
MODEL,
dtype: "int8",
device: "cpu",
)
vec = embedder.("hello world")
puts vec.length
puts vec.first(5).inspect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment