You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -359,6 +359,7 @@ See the [API documentation](./docs/api.md) for all endpoints.
359
359
-[Nosia](https://github.com/nosia-ai/nosia) (Easy to install and use RAG platform based on Ollama)
360
360
-[Witsy](https://github.com/nbonamy/witsy) (An AI Desktop application avaiable for Mac/Windows/Linux)
361
361
-[Abbey](https://github.com/US-Artificial-Intelligence/abbey) (A configurable AI interface server with notebooks, document storage, and YouTube support)
362
+
-[Minima](https://github.com/dmayboroda/minima) (RAG with on-premises or fully local workflow)
-`options`: additional model parameters listed in the documentation for the [Modelfile](./modelfile.md#valid-parameters-and-values) such as `temperature`
50
50
-`system`: system message to (overrides what is defined in the `Modelfile`)
51
51
-`template`: the prompt template to use (overrides what is defined in the `Modelfile`)
52
-
-`context`: the context parameter returned from a previous request to `/generate`, this can be used to keep a short conversational memory
53
52
-`stream`: if `false` the response will be returned as a single response object, rather than a stream of objects
54
53
-`raw`: if `true` no formatting will be applied to the prompt. You may choose to use the `raw` parameter if you are specifying a full templated prompt in your request to the API
55
54
-`keep_alive`: controls how long the model will stay loaded into memory following the request (default: `5m`)
55
+
-`context` (deprecated): the context parameter returned from a previous request to `/generate`, this can be used to keep a short conversational memory
Copy file name to clipboardExpand all lines: docs/faq.md
+26-2Lines changed: 26 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -151,7 +151,7 @@ Refer to the section [above](#how-do-i-configure-ollama-server) for how to set e
151
151
152
152
Ollama runs an HTTP server and can be exposed using a proxy server such as Nginx. To do so, configure the proxy to forward requests and optionally set required headers (if not exposing Ollama on the network). For example, with Nginx:
153
153
154
-
```
154
+
```nginx
155
155
server {
156
156
listen 80;
157
157
server_name example.com;# Replace with your domain or IP
@@ -285,4 +285,28 @@ Note: Windows with Radeon GPUs currently default to 1 model maximum due to limit
285
285
286
286
## How does Ollama load models on multiple GPUs?
287
287
288
-
Installing multiple GPUs of the same brand can be a great way to increase your available VRAM to load larger models. When you load a new model, Ollama evaluates the required VRAM for the model against what is currently available. If the model will entirely fit on any single GPU, Ollama will load the model on that GPU. This typically provides the best performance as it reduces the amount of data transfering across the PCI bus during inference. If the model does not fit entirely on one GPU, then it will be spread across all the available GPUs.
288
+
When loading a new model, Ollama evaluates the required VRAM for the model against what is currently available. If the model will entirely fit on any single GPU, Ollama will load the model on that GPU. This typically provides the best performance as it reduces the amount of data transferring across the PCI bus during inference. If the model does not fit entirely on one GPU, then it will be spread across all the available GPUs.
289
+
290
+
## How can I enable Flash Attention?
291
+
292
+
Flash Attention is a feature of most modern models that can significantly reduce memory usage as the context size grows. To enable Flash Attention, set the `OLLAMA_FLASH_ATTENTION` environment variable to `1` when starting the Ollama server.
293
+
294
+
## How can I set the quantization type for the K/V cache?
295
+
296
+
The K/V context cache can be quantized to significantly reduce memory usage when Flash Attention is enabled.
297
+
298
+
To use quantized K/V cache with Ollama you can set the following environment variable:
299
+
300
+
- `OLLAMA_KV_CACHE_TYPE` - The quantization type for the K/V cache. Default is `f16`.
301
+
302
+
> Note: Currently this is a global option - meaning all models will run with the specified quantization type.
303
+
304
+
The currently available K/V cache quantization types are:
305
+
306
+
- `f16` - high precision and memory usage (default).
307
+
- `q8_0` - 8-bit quantization, uses approximately 1/2 the memory of `f16` with a very small loss in precision, this usually has no noticeable impact on the model's quality (recommended if not using f16).
308
+
- `q4_0` - 4-bit quantization, uses approximately 1/4 the memory of `f16` with a small-medium loss in precision that may be more noticeable at higher context sizes.
309
+
310
+
How much the cache quantization impacts the model's response quality will depend on the model and the task. Models that have a high GQA count (e.g. Qwen2) may see a larger impact on precision from quantization than models with a low GQA count.
311
+
312
+
You may need to experiment with different quantization types to find the best balance between memory usage and quality.
0 commit comments