[GH-ISSUE #2906] chat api stuck when using two ChatOllama same time #1781

Closed
opened 2026-04-12 11:48:20 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @levin8023 on GitHub (Mar 4, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/2906

use langchain for testing llm, when two client connect to ollama for chat api response, it stuck with same following code:
ChatOllama(model=xxx, base_url=xxx, verbose=True, temperature=0, num_ctx=2048) (same model)
and i have to restart ollama server, is there any solutions to use ollama chat api for more then 1 client same time ?

image

Originally created by @levin8023 on GitHub (Mar 4, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/2906 use langchain for testing llm, when two client connect to ollama for chat api response, it stuck with same following code: `ChatOllama(model=xxx, base_url=xxx, verbose=True, temperature=0, num_ctx=2048)` (same model) and i have to restart ollama server, is there any solutions to use ollama chat api for more then 1 client same time ? ![image](https://github.com/ollama/ollama/assets/30230347/3c7bff72-36d1-40a6-a3dd-8eb3bbab8d57)
Author
Owner

@pdevine commented on GitHub (May 15, 2024):

Hey @levin8023 you can set the experimental flags:

OLLAMA_NUM_PARALLEL=2 and OLLAMA_MAX_LOADED_MODELS=2 when starting ollama serve (you can see the documentation for how to set that in the FAQ. That will allow 2 models to be loaded simultaneously and both run inference at the same time.

Hopefully this helps! I'll go ahead and close the issue.

<!-- gh-comment-id:2111400460 --> @pdevine commented on GitHub (May 15, 2024): Hey @levin8023 you can set the experimental flags: `OLLAMA_NUM_PARALLEL=2` and `OLLAMA_MAX_LOADED_MODELS=2` when starting `ollama serve` (you can see the documentation for how to set that in the [FAQ](https://github.com/ollama/ollama/blob/main/docs/faq.md#how-do-i-configure-ollama-server). That will allow 2 models to be loaded simultaneously and both run inference at the same time. Hopefully this helps! I'll go ahead and close the issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#1781