[GH-ISSUE #3021] API endpoint for encoding and decoding tokens #63894

Closed
opened 2026-05-03 15:19:47 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @Hansson0728 on GitHub (Mar 9, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/3021

Please please someone who knows go... add so the internal llamacpp encode endpoint is avilable to the ollama api, so we can use the llm tokenizer to measure how much context we are using accuratly, so we can pick and choose in our memory instead of only trimming from the beginning of our messages, please please

Originally created by @Hansson0728 on GitHub (Mar 9, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/3021 Please please someone who knows go... add so the internal llamacpp encode endpoint is avilable to the ollama api, so we can use the llm tokenizer to measure how much context we are using accuratly, so we can pick and choose in our memory instead of only trimming from the beginning of our messages, please please
GiteaMirror added the feature request label 2026-05-03 15:19:47 -05:00
Author
Owner

@Hansson0728 commented on GitHub (Mar 9, 2024):

Merge #2410 :)

<!-- gh-comment-id:1986793560 --> @Hansson0728 commented on GitHub (Mar 9, 2024): Merge #2410 :)
Author
Owner

@levithomason commented on GitHub (Mar 13, 2024):

Duplicate #1345. This would be a great feature.

<!-- gh-comment-id:1992869337 --> @levithomason commented on GitHub (Mar 13, 2024): Duplicate #1345. This would be a great feature.
Author
Owner

@jmorganca commented on GitHub (Sep 4, 2024):

Will merge this with https://github.com/ollama/ollama/issues/3582

<!-- gh-comment-id:2327895104 --> @jmorganca commented on GitHub (Sep 4, 2024): Will merge this with https://github.com/ollama/ollama/issues/3582
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#63894