Skip to content

Ollama modules not working #336

Open

Description

@javvadisrinivas-vm
Image when i am trying to connect ollama.pls find screenshot error.

Activity

  1. droidblastnz commented on May 11, 2026

    @droidblastnz

    Same using Ollama locally with qwen and the API is ollama ...

    Image
  2. Chenglong-MS commented on May 11, 2026

    @Chenglong-MS
    Collaborator

    Just fixed! It was a bug in the api connection. It's now live in dev branch.

    We'll roll out data-formulator 0.7-alpha-2 today to try it out.

  3. droidblastnz commented on May 11, 2026

    @droidblastnz

    ` KeyError: 'max_completion_tokens'

    2026-05-11 20:48:25,171 - werkzeug - INFO - 192.168.2.140 - - [11/May/2026 20:48:25] "POST /api/agent/test-model HTTP/1.1" 500 -
    2026-05-11 20:48:43,870 - data_formulator.agent_routes - ERROR - Unhandled error in agent route: 'max_completion_tokens'
    2026-05-11 20:48:43,873 - data_formulator.agent_routes - ERROR - Traceback (most recent call last):
    File "/home/vmadmin/projects/myenv/lib/python3.12/site-packages/flask/app.py", line 917, in full_dispatch_request
    rv = self.dispatch_request()
    ^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/vmadmin/projects/myenv/lib/python3.12/site-packages/flask/app.py", line 902, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/vmadmin/projects/myenv/lib/python3.12/site-packages/data_formulator/agent_routes.py", line 177, in test_model
    client = get_client(content['model'])
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/vmadmin/projects/myenv/lib/python3.12/site-packages/data_formulator/agent_routes.py", line 78, in get_client
    client = Client(
    ^^^^^^^
    File "/home/vmadmin/projects/myenv/lib/python3.12/site-packages/data_formulator/agents/client_utils.py", line 45, in init
    self.params["max_tokens"] = self.params["max_completion_tokens"]
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
    KeyError: 'max_completion_tokens'
    2026-05-11 20:48:43,875 - werkzeug - INFO - 192.168.2.140 - - [11/May/2026 20:48:43] "POST /api/agent/test-model HTTP/1.1" 500 -
    2026-05-11 20:51:00,770 - data_formulator.agent_routes - ERROR - Unhandled error in agent route: 'max_completion_tokens'
    2026-05-11 20:51:00,773 - data_formulator.agent_routes - ERROR - Traceback (most recent call last):
    File "/home/vmadmin/projects/myenv/lib/python3.12/site-packages/flask/app.py", line 917, in full_dispatch_request
    rv = self.dispatch_request()
    ^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/vmadmin/projects/myenv/lib/python3.12/site-packages/flask/app.py", line 902, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/vmadmin/projects/myenv/lib/python3.12/site-packages/data_formulator/agent_routes.py", line 177, in test_model
    client = get_client(content['model'])
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/vmadmin/projects/myenv/lib/python3.12/site-packages/data_formulator/agent_routes.py", line 78, in get_client
    client = Client(
    ^^^^^^^
    File "/home/vmadmin/projects/myenv/lib/python3.12/site-packages/data_formulator/agents/client_utils.py", line 45, in init
    self.params["max_tokens"] = self.params["max_completion_tokens"]
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
    KeyError: 'max_completion_tokens'
    2026-05-11 20:51:00,774 - werkzeug - INFO - 192.168.2.140 - - [11/May/2026 20:51:00] "POST /api/agent/test-model HTTP/1.1" 500 -
    nano /home/vmadmin/projects/myenv/lib/python3.12/site-packages/data_formulator/agents/client_utils.py

    change line 45
    self.params["max_tokens"] = self.params["max_completion_tokens"]

    to
    self.params["max_tokens"] = self.params.get("max_completion_tokens", 4096)

    Restart in my case diff port

    (myenv) vmadmin@orangepi5:~$ python -m data_formulator --port 9000
      Loading data connectors...
      Loading AI agents...
    Starting Data Formulator...
    Ready! Open http://localhost:9000 in your browser.
     * Serving Flask app 'data_formulator.app'
     * Debug mode: off
    2026-05-11 20:54:59,556 - werkzeug - INFO - WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
     * Running on all addresses (0.0.0.0)
     * Running on http://127.0.0.1:9000
     * Running on http://192.168.2.130:9000
    2026-05-11 20:54:59,556 - werkzeug - INFO - Press CTRL+C to quit
    2026-05-11 20:56:46,558 - werkzeug - INFO - 192.168.2.140 - - [11/May/2026 20:56:46] "POST /api/agent/test-model HTTP/1.1" 200 
    ```-
    
    <img width="866" height="401" alt="Image" src="https://github.com/user-attachments/assets/14f751f4-6752-4c35-ab08-cbb8cc306a2a" />
    
  4. Chenglong-MS commented on May 11, 2026

    @Chenglong-MS
    Collaborator

    That's right, the current dev branch has fixed it. :)

    https://github.com/microsoft/data-formulator/tree/dev

    Going live to main in a little bit. Thanks a lot for finding it out!

  5. droidblastnz commented on May 11, 2026

    @droidblastnz

    That's right, the current dev branch has fixed it. :)

    https://github.com/microsoft/data-formulator/tree/dev

    Going live to main in a little bit. Thanks a lot for finding it out!

    Sorry had to edit line 45 to make the dev ver work
    self.params["max_tokens"] = self.params.get("max_completion_tokens", 4096)

  6. Chenglong-MS commented on May 12, 2026

    @Chenglong-MS
    Collaborator

    The fixed version is now in pip pre-release 0.7 alpha 2 version, you can directly check it via this:

    pip install --pre data-formulator

    You find the exactly cause!

  7. javvadisrinivas-vm commented on May 29, 2026

    @javvadisrinivas-vm
    Author

    data-formulator 0.7 working fine with ollama.thank you

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions