Skip to content

Improve Ollama connection errors and add LLM health endpoint #268

@sanvishukla

Description

@sanvishukla

Summary

When the Ollama backend is not running or misconfigured, calls to the FireForm pipeline fail with a generic 500 error and a traceback. This is confusing for new users and makes it hard to diagnose basic setup problems. We should improve the error messaging around Ollama connectivity and provide a simple health endpoint that checks whether the LLM backend is ready.

Current behavior

  • LLM calls are made in src/llm.py via LLM.main_loop()
  • If Ollama is not reachable, then:
    • python src/main.py raises a ConnectionError.
    • POST /forms/fill returns a 500 Internal Server Error in Swagger UI.
    • The only guidance is the generic message above, surfaced inside a full Python traceback.
  • For first‑time users, it’s not obvious that:
    • They must start the Ollama server (ollama serve or the macOS app)
    • They must pull the mistral model (ollama pull mistral).
    • OLLAMA_HOST may need to be changed if running in Docker or on another host.

Why this is a problem

  • New users trying the project for the first time often hit this error and see only a 500 + stack trace, with no clear “run this command to fix it” instructions.
  • In a deployed environment, operators need an easy, low‑cost way to verify the LLM backend is healthy without sending a full incident text through the pipeline.
  • If OLLAMA_HOST is set incorrectly, it is hard to distinguish that from “model not pulled” or “daemon not running”.
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Week X Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions