An Elixir wrapper of ollama's REST API with a few niceties built-in, such as dealing with endless LLM repetitions through a timeout.
Ollamex is written based on the ollama REST API documentation for the following endpoints:
- List Local Models
- Generate a completion
- Generate a chat completion
- Generate embeddings (new since v0.2.0)
The primary motivation for this simple Elixir wrapper was to use a timeout and avoid situations in which the LLM gets stuck generating a stream of \n
, \t
and whitespace.
The package is available in Hex and can be installed by adding ollamex
to your list of dependencies in mix.exs
:
def deps do
[
{:ollamex, "~> 0.2.0"}
]
end
The docs can be found at https://hexdocs.pm/ollamex.
The homepage of Ollamex can be found at overbring.com.