Reproduction steps
- Install Ollama 0.15.2 and pull rnj-1:8b model (
ollama pull rnj-1:8b)
- Configure Zed to use Ollama with rnj-1:8b as the model for Agent Panel or Inline Assist
- Open the Agent Panel and send any prompt (e.g., "Please write a function that prints hello world")
- Observe the model generates a response, then immediately generates another nearly-identical response, looping indefinitely until manually interrupted
The same behavior occurs with Inline Assist.
Current vs. Expected behavior
Current behavior:
The model generates output like this, looping indefinitely:
THOUGHT: I need to write a simple JavaScript function...
```javascript
function helloWorld() {
console.log("Hello World");
}
helloWorld();
```<|eot_id|>
THOUGHT: I need to write a simple JavaScript function...
```javascript
function helloWorld() {
console.log("Hello World");
}
helloWorld();
```<|eot_id|>
THOUGHT: I need to write a simple JavaScript function...
[continues forever]
Note the literal <|eot_id|> tokens appearing in the output. This is the model's stop token - it should trigger termination, not appear as visible text.
Expected behavior:
The model should generate a single response and stop. The <|eot_id|> token should trigger Ollama to stop generation, not appear literally in the output.
Evidence that this is a Zed issue, not an Ollama/model issue:
When calling the model directly via Ollama's API, it works correctly:
curl -s http://localhost:11434/api/chat -d '{"model": "rnj-1:8b", "messages": [{"role": "user", "content": "Write a hello world function"}], "stream": false}'
Returns a single, properly-terminated response with "done_reason":"stop". The stop tokens are correctly configured in the model's Modelfile:
PARAMETER stop <|start_header_id|>
PARAMETER stop <|end_header_id|>
PARAMETER stop <|eot_id|>
Other Ollama models (e.g., gpt-oss-20b) work correctly in Zed. Only rnj-1 exhibits this behavior, suggesting Zed may be overriding or not passing stop tokens correctly for this model.
Zed version and system specs
Zed: v0.220.6 (6a75953)
OS: Windows
Ollama: 0.15.2
Attach Zed log file
Zed.log
Relevant Zed settings
settings.json
Relevant Keymap
keymap.json
(for AI issues) Model provider details
- Provider: Ollama (local)
- Model Name: rnj-1:8b (Essential AI)
- Mode: Agent Panel and Inline Assistant (both affected)
- Other details:
- Model correctly configured with stop tokens in Modelfile
- Model works correctly when called directly via Ollama API (curl)
- Other Ollama models (gpt-oss-20b) work correctly in Zed
- Only rnj-1 exhibits this infinite generation behavior
If you are using WSL on Windows, what flavor of Linux are you using?
None
Reproduction steps
ollama pull rnj-1:8b)The same behavior occurs with Inline Assist.
Current vs. Expected behavior
Current behavior:
The model generates output like this, looping indefinitely:
Note the literal
<|eot_id|>tokens appearing in the output. This is the model's stop token - it should trigger termination, not appear as visible text.Expected behavior:
The model should generate a single response and stop. The
<|eot_id|>token should trigger Ollama to stop generation, not appear literally in the output.Evidence that this is a Zed issue, not an Ollama/model issue:
When calling the model directly via Ollama's API, it works correctly:
curl -s http://localhost:11434/api/chat -d '{"model": "rnj-1:8b", "messages": [{"role": "user", "content": "Write a hello world function"}], "stream": false}'Returns a single, properly-terminated response with
"done_reason":"stop". The stop tokens are correctly configured in the model's Modelfile:Other Ollama models (e.g., gpt-oss-20b) work correctly in Zed. Only rnj-1 exhibits this behavior, suggesting Zed may be overriding or not passing stop tokens correctly for this model.
Zed version and system specs
Zed: v0.220.6 (6a75953)
OS: Windows
Ollama: 0.15.2
Attach Zed log file
Zed.log
Relevant Zed settings
settings.json
Relevant Keymap
keymap.json
(for AI issues) Model provider details
If you are using WSL on Windows, what flavor of Linux are you using?
None