Skip to content

Commit

Permalink
⚙️ Adds OLLAMA_FLASH_ATTENTION and OLLAMA_KV_CACHE_TYPE
Browse files Browse the repository at this point in the history
  • Loading branch information
jefftriplett committed Dec 28, 2024
1 parent d31952e commit ba4eac4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions home/.justfiles/ollama.justfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
set dotenv-load := false
set export := true

export OLLAMA_FLASH_ATTENTION := "true"
export OLLAMA_HOST := "0.0.0.0:11434"
export OLLAMA_KEEP_ALIVE := "30m"
export OLLAMA_KV_CACHE_TYPE := "f16"
export OLLAMA_ORIGINS := "http://*"
justfile := justfile_directory() + "/.justfiles/ollama.justfile"

Expand Down Expand Up @@ -55,14 +57,18 @@ justfile := justfile_directory() + "/.justfiles/ollama.justfile"
ollama list

@getenv:
launchctl getenv OLLAMA_FLASH_ATTENTION
launchctl getenv OLLAMA_HOST
launchctl getenv OLLAMA_KEEP_ALIVE
launchctl getenv OLLAMA_KV_CACHE_TYPE
launchctl getenv OLLAMA_ORIGINS

@serve *ARGS:
tandem 'ollama serve {{ ARGS }}'

@setenv:
launchctl setenv OLLAMA_FLASH_ATTENTION {{ OLLAMA_FLASH_ATTENTION }}
launchctl setenv OLLAMA_HOST {{ OLLAMA_HOST }}
launchctl setenv OLLAMA_KEEP_ALIVE {{ OLLAMA_KEEP_ALIVE }}
launchctl setenv OLLAMA_KV_CACHE_TYPE {{ OLLAMA_KV_CACHE_TYPE }}
launchctl setenv OLLAMA_ORIGINS {{ OLLAMA_ORIGINS }}
3 changes: 3 additions & 0 deletions home/.plists/homebrew.mxcl.ollama.plist
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
<string>/opt/homebrew/var</string>
<key>EnvironmentVariables</key>
<dict>
<key>OLLAMA_FLASH_ATTENTION</key><string>true</string>
<key>OLLAMA_KEEP_ALIVE</key><string>30m</string>
<key>OLLAMA_KV_CACHE_TYPE</key><string>f16</string>
<key>OLLAMA_HOST</key><string>0.0.0.0:11434</string>
<key>OLLAMA_ORIGINS</key><string>http://*</string>
</dict>
Expand Down

0 comments on commit ba4eac4

Please sign in to comment.