set flash attention via options? #199

Closed
opened 2026-02-15 16:28:41 -05:00 by yindo · 1 comment
Owner

Originally created by @fishfacegit on GitHub (Jan 9, 2025).

Is it possible to set flash attention via options keyword?
I could not find anything in the docs.

import ollama
model = "llama3.2:3b"
md_text = "Hello..." # some rather long text
ollama.embed(model=model, input=md_text, truncate=False, options={"num_ctx": 60000, "flash_attn": 1})
Originally created by @fishfacegit on GitHub (Jan 9, 2025). Is it possible to set flash attention via options keyword? I could not find anything in the docs. ```python import ollama model = "llama3.2:3b" md_text = "Hello..." # some rather long text ollama.embed(model=model, input=md_text, truncate=False, options={"num_ctx": 60000, "flash_attn": 1}) ```
yindo closed this issue 2026-02-15 16:28:41 -05:00
Author
Owner

@ParthSareen commented on GitHub (Jan 21, 2025):

Hey! You can set it with env vars - OLLAMA_FLASH_ATTENTION environment variable to 1

@ParthSareen commented on GitHub (Jan 21, 2025): Hey! You can set it with env vars - `OLLAMA_FLASH_ATTENTION` environment variable to `1`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ollama/ollama-python#199