Fix Ollama API timeout for local LLM inference#23
Conversation
…meouts Co-authored-by: hammar <68027+hammar@users.noreply.github.com>
Co-authored-by: hammar <68027+hammar@users.noreply.github.com>
hammar
left a comment
There was a problem hiding this comment.
Looks promising but please rebase this on the latest main branch (that supports Azure AI Foundry) and ensure that these changes only kick in if we are using a local Ollama client, rather than the AI Foundry client.
Done! Rebased on latest main (commit ed8ddab) which includes Azure AI Foundry support. The timeout configuration now only applies when using the Local Ollama provider (lines 66-87 in Program.cs, inside the Changes in commits 8ef3299, ffcc634. |
|
Restarting work on this PR. |
Fix LLM Timeouts for Local Ollama ✅
Successfully resolved the issue where local Ollama-based LLM operations were timing out after ~10 seconds by configuring extended HTTP timeouts for the Ollama API client.
Problem
System.Threading.Tasks.TaskCanceledExceptionafter ~10 secondsSolution
Changes Made
elseblock at lines 66-86)Security Summary
No security vulnerabilities were introduced. The changes only involve configuration of timeout values and connection pooling settings for HTTP client communication with the local Ollama service.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.