You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue is that while running the Ollama integration tests locally in a loop (script provided), either CodeGate gets stuck in a loop or the curl is left hanging for response.
This was not reproducible when using larger models (1.5B or 7B).
This does not cause a denial of service to CodeGate.
Steps to Reproduce
Run ollama locally
Pull the following model - ollama pull qwen2.5-coder:0.5b
Start CodeGate
Create/activate a venv with the necessary dependencies installed
Run the following script -
#!/bin/bash
FAIL_COUNT=0
TOTAL_RUNS=60
for((i=1; i<=TOTAL_RUNS; i++));doecho"Run #$i"
CODEGATE_PROVIDERS=ollama python tests/integration/integration_tests.py
if [ $?-ne 0 ];then((FAIL_COUNT++))fi
sleep 2
doneecho"Total failures: $FAIL_COUNT out of $TOTAL_RUNS runs."
After debugging this it turns out that this issue was limited to Ollama (I was not able to reproduce this with the other providers I've tested it - llamacpp, openai, copilot, anthropic).
The issue is that the Ollama Server is sometimes hanging and when that happens CodeGate had a 5min timeout which was not resulting in a good fail fast behavior. The solution is to reduce the timeout to 30s.
After further debugging the 2nd issue described here where CodeGate is stuck looping seems to be a bug with Ollama.
The reasons for this are:
In process_stream() CodeGate keeps receiving chunks from that stream without any finish_reason being set to stop which is what causes the endless loop.
I've tried the same use case with other providers (openai, copilot, anthropic, llamacpp) and I was not able to reproduce it.
Re-setting my local environment affects how often I can reproduce the issue which again makes me feel it's some performance issue with Ollama.
That said I think it's alright to close the issue and move forward.
Describe the issue
The issue is that while running the Ollama integration tests locally in a loop (script provided), either CodeGate gets stuck in a loop or the curl is left hanging for response.
This was not reproducible when using larger models (1.5B or 7B).
This does not cause a denial of service to CodeGate.
Steps to Reproduce
ollama pull qwen2.5-coder:0.5b
Operating System
MacOS (Arm)
IDE and Version
None, bash script doing curls
Extension and Version
None, bash script doing curls
Provider
Ollama
Model
qwen2.5-coder:0.5b
Codegate version
Build from main - Commit 7eb57d6
Logs
1. Logs from when the curl is stuck -
2. Logs from when CodeGate is stuck
Additional Context
No response
The text was updated successfully, but these errors were encountered: