Skip to content

When calling the Ollama chat model, Ollama responds slowly, causing a read timeout error. #3572

Closed as duplicate
@yingcanxia

Description

@yingcanxia

Is there any way or configuration to set the timeout for the WebClient when calling Ollama?
If there really isn't a way, may I ask if this feature can be added in the next version?

Bug description
When doing RAG, my prompt content is quite large. Directly calling Ollama to generate a result takes about 10 seconds, but when using spring-ai-starter-model-ollama, it immediately returns a read timeout.

Environment
spring-ai : 1.0.0

Steps to reproduce
Steps to reproduce the issue.

Expected behavior
Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: org.springframework.web.client.ResourceAccessException: I/O error on POST request for "http://localhost:11434/api/chat": Read timed out] with root cause

Minimal Complete Reproducible example
Please provide a failing test or a minimal complete verifiable example that reproduces the issue.
Bug reports that are reproducible will take priority in resolution over reports that are not reproducible.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions