module

Semtrace::Ollama

Minimal Ollama API client for getting contextual embeddings.

Constants

DEFAULT_URL = "http://localhost:11434"

Class methods

embed(text : String, model : String = "llama3.2:3b", base_url : String = DEFAULT_URL) : Array(Float32)

Returns the contextual embedding for a text input from a model's forward pass.

Source
embed_batch(texts : Array(String), model : String = "llama3.2:3b", base_url : String = DEFAULT_URL) : Array(Array(Float32))

Batch embed multiple texts.

Source