[GH-ISSUE #6454] obtain attention matrices during inference, similar to the output_attentions=True parameter in the transformers package #4060

Closed
opened 2026-04-12 14:57:57 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @yuhkalhic on GitHub (Aug 21, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/6454

I'd like to propose a new feature for Ollama: the ability to access attention matrices and/or the KV-Cache during model inference. This functionality is similar to what's available in the Hugging Face Transformers library, where users can set output_attentions=True or access past_key_values.

Originally created by @yuhkalhic on GitHub (Aug 21, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/6454 I'd like to propose a new feature for Ollama: the ability to access attention matrices and/or the KV-Cache during model inference. This functionality is similar to what's available in the Hugging Face Transformers library, where users can set `output_attentions=True` or access `past_key_values`.
GiteaMirror added the feature request label 2026-04-12 14:57:57 -05:00
Author
Owner

@rick-github commented on GitHub (Aug 21, 2024):

This is more likely a feature request for llama.cpp.

<!-- gh-comment-id:2302381344 --> @rick-github commented on GitHub (Aug 21, 2024): This is more likely a feature request for [llama.cpp](https://github.com/ggerganov/llama.cpp/issues).
Author
Owner

@yuhkalhic commented on GitHub (Aug 21, 2024):

This is more likely a feature request for llama.cpp.

OK, thanks

<!-- gh-comment-id:2302641275 --> @yuhkalhic commented on GitHub (Aug 21, 2024): > This is more likely a feature request for [llama.cpp](https://github.com/ggerganov/llama.cpp/issues). OK, thanks
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#4060