[GH-ISSUE #1068] Request: Tokenize endpoint #525

Closed
opened 2026-04-12 10:13:12 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @danemadsen on GitHub (Nov 10, 2023).
Original GitHub issue: https://github.com/ollama/ollama/issues/1068

I'm wanting to feed in example prompt / responses but there doesn't seem to be a way to do it without just attaching them to the system prompt? Is there a way we can have a /api/tokenize endpoint so example prompt / responses can be fed in as context?

Originally created by @danemadsen on GitHub (Nov 10, 2023). Original GitHub issue: https://github.com/ollama/ollama/issues/1068 I'm wanting to feed in example prompt / responses but there doesn't seem to be a way to do it without just attaching them to the system prompt? Is there a way we can have a /api/tokenize endpoint so example prompt / responses can be fed in as context?
Author
Owner

@BruceMacD commented on GitHub (Nov 10, 2023):

Hi @danemadsen thanks for opening the issue, we are working on a messages request parameter that will allow you to pass in request/responses directly, bypassing the need to set a tokenized context. Would that meet your needs?

https://github.com/jmorganca/ollama/pull/991

<!-- gh-comment-id:1804953766 --> @BruceMacD commented on GitHub (Nov 10, 2023): Hi @danemadsen thanks for opening the issue, we are working on a `messages` request parameter that will allow you to pass in request/responses directly, bypassing the need to set a tokenized context. Would that meet your needs? https://github.com/jmorganca/ollama/pull/991
Author
Owner

@danemadsen commented on GitHub (Nov 10, 2023):

Yes i just saw the PR, that will work fine. Though i do think the encode / decode endpoints could also be helpful in certain circumstances as well.

<!-- gh-comment-id:1804955458 --> @danemadsen commented on GitHub (Nov 10, 2023): Yes i just saw the PR, that will work fine. Though i do think the encode / decode endpoints could also be helpful in certain circumstances as well.
Author
Owner

@jmorganca commented on GitHub (Dec 24, 2023):

Closing this issue now that #991 is merged 🎊

<!-- gh-comment-id:1868599628 --> @jmorganca commented on GitHub (Dec 24, 2023): Closing this issue now that #991 is merged 🎊
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#525