Skip to content

Fixed #996: added comprehensive error handling for GenAI pipeline operations#1035

Open
GauravSRC wants to merge 1 commit intoopenvinotoolkit:masterfrom
GauravSRC:fix/issue-996-no-output-generation
Open

Fixed #996: added comprehensive error handling for GenAI pipeline operations#1035
GauravSRC wants to merge 1 commit intoopenvinotoolkit:masterfrom
GauravSRC:fix/issue-996-no-output-generation

Conversation

@GauravSRC
Copy link

Summary

This PR addresses issue #996 where the GenAI Ollama integration fails silently when using unavailable devices (like NPU on systems without NPU hardware), resulting in zero token generation and no error messages.

Root Cause

The original implementation lacked error checking on OpenVINO GenAI C API calls. When operations failed, the code continued execution and returned empty results with all metrics showing 0.00 values.

Changes

genai.go:

  • Modified CreatePipeline() to validate device availability and return errors
  • Modified GenerateTextWithMetrics() to check all C API status codes
  • Added helper functions: IsDeviceAvailable() and GetAvailableDeviceNames()

runner.go:

  • Enhanced loadModel() with error handling and device availability logging
  • Modified processBatch() to propagate generation errors
  • Updated HTTP handlers to return proper error responses

Impact

  • Users now receive clear error messages when devices are unavailable
  • Available devices are logged at startup for easy debugging
  • HTTP API returns proper error responses instead of silent failures

Testing

  • Code compiles without errors
  • Error messages are descriptive and actionable
  • HTTP responses follow JSON error format

…enAI pipeline operations

- Add error checking to all OpenVINO GenAI C API calls
- Validate device availability before pipeline creation
- Return descriptive errors instead of silent failures
- Log available devices at startup for debugging
- Add proper error responses in HTTP API

This fixes the issue where models would fail to generate output
when using unavailable devices (like NPU on systems without NPU hardware).
@GauravSRC GauravSRC requested a review from a team as a code owner February 13, 2026 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments