[GH-ISSUE #9327] How to Enable Flash Attention in Ollama Docker Deployment? #52599

Closed
opened 2026-04-28 23:49:40 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @lixiangge on GitHub (Feb 25, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/9327

I’m trying to deploy Ollama using Docker, and I want to enable Flash Attention for performance improvements. However, I’m not sure where to set the environment variable to activate it. Could anyone point me to the proper place or method to configure it?

Originally created by @lixiangge on GitHub (Feb 25, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/9327 I’m trying to deploy Ollama using Docker, and I want to enable Flash Attention for performance improvements. However, I’m not sure where to set the environment variable to activate it. Could anyone point me to the proper place or method to configure it?
GiteaMirror added the feature request label 2026-04-28 23:49:40 -05:00
Author
Owner

@rick-github commented on GitHub (Feb 25, 2025):

services:
  ollama:
    environment:
     OLLAMA_FLASH_ATTENTION: 1

or

docker run -e OLLAMA_FLASH_ATTENTION=1 ollama/ollama
<!-- gh-comment-id:2681432542 --> @rick-github commented on GitHub (Feb 25, 2025): ```yaml services: ollama: environment: OLLAMA_FLASH_ATTENTION: 1 ``` or ``` docker run -e OLLAMA_FLASH_ATTENTION=1 ollama/ollama ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#52599