Set advanced parameters in ollama embeddings

In ollama api user can define advanced parameters:

  • truncate: truncates the end of each input to fit within context length. Returns error if false and context length is exceeded. Defaults to true
  • options: additional model parameters listed in the documentation for the Modelfile such as temperature
  • keep_alive: controls how long the model will stay loaded into memory following the request (default: 5m)
  • dimensions: number of dimensions for the embedding

source

I mostly look forward to the “dimensions” option, but it would be great to be able to use all the options.