[PR #8106] [CLOSED] server: tokenize & detokenize endpoints #59322

Closed
opened 2026-04-29 14:15:46 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/8106
Author: @ParthSareen
Created: 12/15/2024
Status: Closed

Base: mainHead: parth/tokenize-detokenize


📝 Commits (10+)

📊 Changes

9 files changed (+724 additions, -0 deletions)

View changed files

📝 api/client.go (+18 -0)
📝 api/types.go (+22 -0)
📝 docs/api.md (+65 -0)
📝 llama/llama.go (+15 -0)
server/model_loader.go (+67 -0)
📝 server/routes.go (+103 -0)
📝 server/routes_generate_test.go (+8 -0)
server/routes_tokenization_test.go (+290 -0)
server/routes_tokenize_test.go (+136 -0)

📄 Description

Massive shoutout to @Yurzs for getting this in.

Doing cleanup + tests.
Closes: https://github.com/ollama/ollama/issues/3582

TO-DO:


🔄 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/8106 **Author:** [@ParthSareen](https://github.com/ParthSareen) **Created:** 12/15/2024 **Status:** ❌ Closed **Base:** `main` ← **Head:** `parth/tokenize-detokenize` --- ### 📝 Commits (10+) - [`e60db34`](https://github.com/ollama/ollama/commit/e60db349b7e06e8ad0e66edd0fef3c171d47a554) api: expose tokenize and detokenize endpoints - [`24613df`](https://github.com/ollama/ollama/commit/24613df09473cc96f1afd39f98464e8b435d44ed) docs: add tokenize and detokenize api - [`6fad163`](https://github.com/ollama/ollama/commit/6fad1637edd486b6be87c8e88235cbde699e1208) Cleanup - [`a5e66a1`](https://github.com/ollama/ollama/commit/a5e66a1163ef88b7b3ade2e659ab90ba327ac2e2) Better err handling - [`da35ad8`](https://github.com/ollama/ollama/commit/da35ad878b330bdf387e4965448783d52e840fe4) update docs - [`f0a5f79`](https://github.com/ollama/ollama/commit/f0a5f7994bf74b13aa11760cb51d7666956a76ce) add tests - [`e679885`](https://github.com/ollama/ollama/commit/e67988573330cab1ed46a3af63524de9db7f7117) WIP updated routes - [`1e545ea`](https://github.com/ollama/ollama/commit/1e545ea7a061df0bd357c2fc60f1031151081c3c) Add caching for model loading - [`11acb85`](https://github.com/ollama/ollama/commit/11acb85ff34eedd260b5b9835a6ea6b224448ce6) WIP - [`e3dd901`](https://github.com/ollama/ollama/commit/e3dd90102d3dc47f346046a487806d10c01e59fb) WIP ### 📊 Changes **9 files changed** (+724 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `api/client.go` (+18 -0) 📝 `api/types.go` (+22 -0) 📝 `docs/api.md` (+65 -0) 📝 `llama/llama.go` (+15 -0) ➕ `server/model_loader.go` (+67 -0) 📝 `server/routes.go` (+103 -0) 📝 `server/routes_generate_test.go` (+8 -0) ➕ `server/routes_tokenization_test.go` (+290 -0) ➕ `server/routes_tokenize_test.go` (+136 -0) </details> ### 📄 Description Massive shoutout to @Yurzs for getting this in. Doing cleanup + tests. Closes: https://github.com/ollama/ollama/issues/3582 TO-DO: - [ ] Python SDK: https://github.com/ollama/ollama-python/pull/383 - [ ] JS SDK: https://github.com/ollama/ollama-js/pull/179 - [ ] Benchmarking w/ & w/o caching --- <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-29 14:15:46 -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#59322