Skip to content

Conversation

@jjmachan
Copy link
Member

This PR addresses the issues reported in #2044 where local LLMs like Ollama with qwen2.5:14b were encountering RagasOutputParserException and TimeoutError during evaluation.

Changes

  1. Increased default timeout in RunConfig from 180 to 300 seconds to accommodate slower local LLMs
  2. Enhanced extract_json function to better handle various LLM output formats:
    • Added support for markdown code blocks
    • Added handling for single quotes in JSON
    • Added handling for trailing commas in JSON
    • Improved JSON extraction from text with surrounding content
  3. Improved RagasOutputParser with:
    • More robust error handling
    • Increased default retries from 1 to 3
    • Better error messages with details about the failure
    • Added suggestions for working with local LLMs in error messages

Added tests

  • Tests for extract_json with various input formats
  • Tests for RagasOutputParser fallback mechanism
  • Tests for timeout configuration

Fixes #2044

@jjmachan can click here to continue refining the PR

This commit addresses the issues reported in #2044 where local LLMs like Ollama with qwen2.5:14b
were encountering RagasOutputParserException and TimeoutError during evaluation.

Changes:
1. Increased default timeout in RunConfig from 180 to 300 seconds to accommodate slower local LLMs
2. Enhanced extract_json function to better handle various LLM output formats:
   - Added support for markdown code blocks
   - Added handling for single quotes in JSON
   - Added handling for trailing commas in JSON
   - Improved JSON extraction from text with surrounding content
3. Improved RagasOutputParser with:
   - More robust error handling
   - Increased default retries from 1 to 3
   - Better error messages with details about the failure
   - Added suggestions for working with local LLMs in error messages

Added tests:
- Tests for extract_json with various input formats
- Tests for RagasOutputParser fallback mechanism
- Tests for timeout configuration
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label May 17, 2025
@jjmachan jjmachan closed this Aug 26, 2025
@anistark anistark deleted the openhands/fix-local-llm-output-parsing branch November 18, 2025 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Evaluation Errors: Output Parsing and Timeout Issues for Context/Faithfulness Metrics

3 participants