Skip to content

[Bug]: ollama_embed error on ollama higher 13.3ย #921

@weisshaj

Description

@weisshaj

What happened?

After I update ollama the function ollama_embed broke. The error apperas if ollama is higher then version 13.3.

pgai extension affected

0.11.2

pgai library affected

0.12.1

PostgreSQL version used

17

What operating system did you use?

Ubuntu 24.04

What installation method did you use?

Docker

What platform did you run on?

On prem/Self-hosted

Relevant log output and stack trace

SQL Error [38000]: ERROR: ollama._types.ResponseError: failed to encode response: json: unsupported value: NaN
  Where: Traceback (most recent call last):
  PL/Python function "ollama_embed", line 38, in <module>
    resp = client.embeddings(model, input_text, options=embedding_options_1, keep_alive=keep_alive)
  PL/Python function "ollama_embed", line 378, in embeddings
  PL/Python function "ollama_embed", line 176, in _request
  PL/Python function "ollama_embed", line 121, in _request_raw
PL/Python function "ollama_embed"

How can we reproduce the bug?

Run ollama_embed on ollama higher 13.3

Are you going to work on the bugfix?

๐Ÿ†˜ No, could someone else please work on the bugfix?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions