Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use json_stream for ollama to improve reliability #549

Merged
merged 4 commits into from
May 29, 2024

Conversation

ProjectMoon
Copy link
Contributor

Fixes #548.

Instead of assuming that the streamed response will be a complete valid JSON line, use the json_stream function to handle cases where the server has not fully returned the line of JSON yet. This fixes cases where ollama is reverse proxied, and the proxy is not streaming exactly the same way as ollama does.

@sigoden sigoden changed the title Use JSON stream for ollama to improve reliability. refactor: use json_stream for ollama to improve reliability May 29, 2024
@sigoden sigoden merged commit 00f3cb1 into sigoden:main May 29, 2024
3 checks passed
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.

Ollama streaming can break when going through a reverse proxy
2 participants