[GH-ISSUE #2923] how does memory work in cmd ollama run openchat? #1792

Closed
opened 2026-04-12 11:49:18 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @TimmekHW on GitHub (Mar 4, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/2923

how does memory work in cmd ollama run openchat?

could you share the code? remembering chat history and context works well there. can I please have the code? Because my implementation of history is not working correctly

Originally created by @TimmekHW on GitHub (Mar 4, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/2923 how does memory work in cmd `ollama run openchat`? could you share the code? remembering chat history and context works well there. can I please have the code? Because my implementation of history is not working correctly
Author
Owner

@mxyng commented on GitHub (Mar 6, 2024):

The code is open source. Specifically here.

To summarize, ollama run uses /api/chat which takes messages as inputs. History is created by appending to messages

<!-- gh-comment-id:1981962970 --> @mxyng commented on GitHub (Mar 6, 2024): The code is open source. Specifically [here](https://github.com/ollama/ollama/blob/main/cmd/interactive.go). To summarize, `ollama run` uses `/api/chat` which takes messages as inputs. History is created by appending to messages
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#1792