[PR #5348] [CLOSED] Enable grammar and JSON Schema support #37627

Closed
opened 2026-04-22 22:18:11 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/5348
Author: @mitar
Created: 6/27/2024
Status: Closed

Base: mainHead: json-schema


📝 Commits (1)

  • 63413e2 Enable grammar and JSON Schema support.

📊 Changes

4 files changed (+33 additions, -3 deletions)

View changed files

📝 api/types.go (+2 -0)
📝 llm/ext_server/server.cpp (+20 -3)
📝 llm/ext_server/utils.hpp (+1 -0)
📝 llm/server.go (+10 -0)

📄 Description

Other PRs adding JSON Schema support I have seen have not added the corresponding code to the C++ server part so JSON Schema was not really working. This is working and tested implementation (based on the upstream llama.cpp implementation).


🔄 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/5348 **Author:** [@mitar](https://github.com/mitar) **Created:** 6/27/2024 **Status:** ❌ Closed **Base:** `main` ← **Head:** `json-schema` --- ### 📝 Commits (1) - [`63413e2`](https://github.com/ollama/ollama/commit/63413e2696c955719b31d7dd328bcc05a13e7950) Enable grammar and JSON Schema support. ### 📊 Changes **4 files changed** (+33 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `api/types.go` (+2 -0) 📝 `llm/ext_server/server.cpp` (+20 -3) 📝 `llm/ext_server/utils.hpp` (+1 -0) 📝 `llm/server.go` (+10 -0) </details> ### 📄 Description Other PRs adding JSON Schema support I have seen have not added the corresponding code to the C++ server part so JSON Schema was not really working. This is working and tested implementation (based on the upstream llama.cpp implementation). --- <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-22 22:18:11 -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#37627