8000 Running with Ollama throws Pydantic error · Issue #17 · GNtousakis/llm-commit · GitHub
[go: up one dir, main page]

Skip to content

Running with Ollama throws Pydantic error #17

Open

Description

@saemideluxe

I was trying to run this with a local Ollama (with llm-ollama installed) setup, but I get the following error message:

WARNING: Diff is large; truncating to 4000 characters.
INFO: HTTP Request: GET http://127.0.0.1:11434/api/tags "HTTP/1.1 200 OK"
INFO: HTTP Request: POST http://127.0.0.1:11434/api/show "HTTP/1.1 200 OK"
INFO: HTTP Request: POST http://127.0.0.1:11434/api/show "HTTP/1.1 200 OK"
Traceback (most recent call last):
  File "/usr/bin/llm", line 33, in <module>
    sys.exit(load_entry_point('llm==0.23', 'console_scripts', 'llm')())
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3/dist-packages/click/core.py", line 1161, in __call__
    return self.main(*args, **kwargs)
           ~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/click/core.py", line 1082, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1697, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/usr/lib/python3/dist-packages/click/core.py", line 1443, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/click/core.py", line 788, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.13/dist-packages/llm_commit.py", line 253, in commit_cmd
    message = generate_commit_message(diff, commit_style, model=model, max_tokens=max_tokens, temperature=temperature, hint=hint)
  File "/usr/local/lib/python3.13/dist-packages/llm_commit.py", line 178, in generate_commit_message
    response = model_obj.prompt(
        prompt,
    ...<10 lines>...
        temperature=temperature
    )
  File "/usr/lib/python3/dist-packages/llm/models.py", line 746, in prompt
    options=self.Options(**options),
            ~~~~~~~~~~~~^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pydantic/main.py", line 214, in __init__
    validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self)
pydantic_core._pydantic_core.ValidationError: 1 validation error for Options
max_tokens
  Extra inputs are not permitted [type=extra_forbidden, input_value=100, input_type=int]
    For further information visit https://errors.pydantic.dev/2.10/v/extra_forbidden

Any ideas? My understanding was, that ollama is API-compatible with OpenAI?

Activity

  1. glenux commented on Apr 4, 2025

    @glenux
    Contributor

    It seems that :

    IMHO, that should be handled by the datasette LLM project (with some abstraction layer) not by llm-commit.

  2. guilhermeprokisch commented on Apr 6, 2025

    @guilhermeprokisch

    Any easy fix for that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0