[PR #5312] [MERGED] OpenAI Compatibility: Correct Finish Reason Documentation #11741

Closed
opened 2026-04-12 23:37:53 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/5312
Author: @royjhan
Created: 6/26/2024
Status: Merged
Merged: 6/28/2024
Merged by: @royjhan

Base: mainHead: royh-doc


📝 Commits (1)

📊 Changes

1 file changed (+0 additions, -1 deletions)

View changed files

📝 docs/openai.md (+0 -1)

📄 Description

finish_reason is not bound to only being stop

curl http://localhost:11434/v1/chat/completions \
    -H "Content-Type: application/json" \
    -d '{
        "model": "llama3",
        "messages": [
            {
                "role": "system",
                "content": "You are a helpful assistant."
            },
            {
                "role": "user",
                "content": "Hello!"
            }
        ],
       "max_tokens": 1
    }' | jq

{
  "id": "chatcmpl-20",
  "object": "chat.completion",
  "created": 1719437652,
  "model": "llama3",
  "system_fingerprint": "fp_ollama",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello"
      },
      "finish_reason": "length"
    }
  ],
  "usage": {
    "prompt_tokens": 23,
    "completion_tokens": 1,
    "total_tokens": 24
  }
}

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/5312 **Author:** [@royjhan](https://github.com/royjhan) **Created:** 6/26/2024 **Status:** ✅ Merged **Merged:** 6/28/2024 **Merged by:** [@royjhan](https://github.com/royjhan) **Base:** `main` ← **Head:** `royh-doc` --- ### 📝 Commits (1) - [`6d6690b`](https://github.com/ollama/ollama/commit/6d6690b567a945ae7ff0b7e4a596d2a46bc35dc8) Update docs ### 📊 Changes **1 file changed** (+0 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `docs/openai.md` (+0 -1) </details> ### 📄 Description `finish_reason` is not bound to only being `stop` ``` curl http://localhost:11434/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{ "model": "llama3", "messages": [ { "role": "system", "content": "You are a helpful assistant." }, { "role": "user", "content": "Hello!" } ], "max_tokens": 1 }' | jq { "id": "chatcmpl-20", "object": "chat.completion", "created": 1719437652, "model": "llama3", "system_fingerprint": "fp_ollama", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Hello" }, "finish_reason": "length" } ], "usage": { "prompt_tokens": 23, "completion_tokens": 1, "total_tokens": 24 } } ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-12 23:37:53 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#11741