[PR #6586] [CLOSED] Expose Tokenize and Detokenize API #12161

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

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/6586
Author: @Yurzs
Created: 9/1/2024
Status: Closed

Base: mainHead: tokenize


📝 Commits (2)

  • 19a388b api: expose tokenize and detokenize endpoints
  • cf2fb5e docs: add tokenize and detokenize api

📊 Changes

4 files changed (+187 additions, -0 deletions)

View changed files

📝 api/client.go (+18 -0)
📝 api/types.go (+38 -0)
📝 docs/api.md (+79 -0)
📝 server/routes.go (+52 -0)

📄 Description

Exposed tokenize and detokenize API.
Checked that prompt is tokenized and detokenized correctly locally.
Closes: https://github.com/ollama/ollama/issues/3582


🔄 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/6586 **Author:** [@Yurzs](https://github.com/Yurzs) **Created:** 9/1/2024 **Status:** ❌ Closed **Base:** `main` ← **Head:** `tokenize` --- ### 📝 Commits (2) - [`19a388b`](https://github.com/ollama/ollama/commit/19a388bfb8d65569e21d55e7d7bc6b40a1c1da5d) api: expose tokenize and detokenize endpoints - [`cf2fb5e`](https://github.com/ollama/ollama/commit/cf2fb5e0ea1a88380467b91dc64f8027edf3de1d) docs: add tokenize and detokenize api ### 📊 Changes **4 files changed** (+187 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `api/client.go` (+18 -0) 📝 `api/types.go` (+38 -0) 📝 `docs/api.md` (+79 -0) 📝 `server/routes.go` (+52 -0) </details> ### 📄 Description Exposed tokenize and detokenize API. Checked that prompt is tokenized and detokenized correctly locally. Closes: https://github.com/ollama/ollama/issues/3582 --- <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:50:57 -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#12161