[GH-ISSUE #14073] New default context lengths will break #71252

Open
opened 2026-05-05 00:56:29 -05:00 by GiteaMirror · 23 comments
Owner

Originally created by @tonydiep on GitHub (Feb 4, 2026).
Original GitHub issue: https://github.com/ollama/ollama/issues/14073

The new default context lengths in 0.15.5 will break on my machine with 52gb VRAM. Ollama will be unresponsive because it will spill onto CPU until I can get into it to set context to fit within VRAM.

RECOMMENDATIONS

  1. Reduce jump in num_ctx from 256k to 64k or 96k, or
  2. Have Ollama dynamically increase default context size but still fit entirely in VRAM. (I do this manually increasing num_ctx until GPU=100% and CPU=0% but why not have Ollama do it?)

According to 0.15.5 (pre-release) notes:

Ollama will now default to the following context lengths based on VRAM:
    < 24 GiB VRAM: 4,096 context
    24-48 GiB VRAM: 32,768 context
    >= 48 GiB VRAM: 262,144 context
Originally created by @tonydiep on GitHub (Feb 4, 2026). Original GitHub issue: https://github.com/ollama/ollama/issues/14073 The new default context lengths in 0.15.5 will break on my machine with 52gb VRAM. Ollama will be unresponsive because it will spill onto CPU until I can get into it to set context to fit within VRAM. # RECOMMENDATIONS 1. Reduce jump in num_ctx from 256k to 64k or 96k, or 2. Have Ollama dynamically increase default context size but still fit entirely in VRAM. (I do this manually increasing num_ctx until GPU=100% and CPU=0% but why not have Ollama do it?) According to 0.15.5 (pre-release) notes: ``` Ollama will now default to the following context lengths based on VRAM: < 24 GiB VRAM: 4,096 context 24-48 GiB VRAM: 32,768 context >= 48 GiB VRAM: 262,144 context ```
Author
Owner

@jessegross commented on GitHub (Feb 4, 2026):

What model and hardware are you using?

<!-- gh-comment-id:3849556020 --> @jessegross commented on GitHub (Feb 4, 2026): What model and hardware are you using?
Author
Owner

@illusdolphin commented on GitHub (Feb 4, 2026):

Sample - RTX 6000 Pro, 96 GB, trying to run new 1B model glm-ocr based on sample from docs:
PS C:\Users...\Desktop> ollama run glm-ocr Text Recognition: ./image.png
Error: 500 Internal Server Error: model failed to load, this may be due to resource limitations or an internal error, check ollama server logs for details

guess the reason: ">= 48 GiB VRAM: 262,144 context" . Via API it also throws an error and works only if apply meaningful context length via options.

<!-- gh-comment-id:3849698821 --> @illusdolphin commented on GitHub (Feb 4, 2026): Sample - RTX 6000 Pro, 96 GB, trying to run new 1B model glm-ocr based on sample from docs: PS C:\Users\...\Desktop> ollama run glm-ocr Text Recognition: ./image.png Error: 500 Internal Server Error: model failed to load, this may be due to resource limitations or an internal error, check ollama server logs for details guess the reason: ">= 48 GiB VRAM: 262,144 context" . Via API it also throws an error and works only if apply meaningful context length via options.
Author
Owner

@jessegross commented on GitHub (Feb 4, 2026):

glm-ocr should fit easily into that GPU at max context length:

NAME              ID              SIZE     PROCESSOR    CONTEXT    UNTIL              
glm-ocr:latest    6effedd0dc8a    15 GB    100% GPU     131072     4 minutes from now    

Please post the server logs so we can see what is happening.

<!-- gh-comment-id:3849947566 --> @jessegross commented on GitHub (Feb 4, 2026): glm-ocr should fit easily into that GPU at max context length: ``` NAME ID SIZE PROCESSOR CONTEXT UNTIL glm-ocr:latest 6effedd0dc8a 15 GB 100% GPU 131072 4 minutes from now ``` Please post the server logs so we can see what is happening.
Author
Owner

@tonydiep commented on GitHub (Feb 4, 2026):

I think the point is that a default of 256k context is not a good default.

With 52gb VRAM, some of my models can go up to 190k and fit in vram. Others, like Deepseek R1 70b can only go up 10k context before it has to spill to CPU.

Consider GLM4.7-flash before the memory fix. Using the new default of 256k and maxxing out the GLM4.7's 198k context would have spilled onto CPU and crashed Ollama by default.

A safer default would be 32k or 64k (or making sure the context still fits in VRAM)

  • Tony Diep (He/Him)

From: Jesse Gross @.>
Sent: February 4, 2026 4:55 PM
To: ollama/ollama @.
>
Cc: Tony Diep @.>; Author @.>
Subject: Re: [ollama/ollama] New default context lengths will break (Issue #14073)

[https://avatars.githubusercontent.com/u/6468499?s=20&v=4]jessegross left a comment (ollama/ollama#14073)https://github.com/ollama/ollama/issues/14073#issuecomment-3849947566

glm-ocr should fit easily into that GPU at max context length:

NAME ID SIZE PROCESSOR CONTEXT UNTIL
glm-ocr:latest 6effedd0dc8a 15 GB 100% GPU 131072 4 minutes from now

Please post the server logs so we can see what is happening.


Reply to this email directly, view it on GitHubhttps://github.com/ollama/ollama/issues/14073#issuecomment-3849947566, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAFMF5I5Z55JDHWKOUTVHLL4KJTGFAVCNFSM6AAAAACT7UI3GOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTQNBZHE2DONJWGY.
You are receiving this because you authored the thread.Message ID: @.***>

<!-- gh-comment-id:3850009039 --> @tonydiep commented on GitHub (Feb 4, 2026): I think the point is that a default of 256k context is not a good default. With 52gb VRAM, some of my models can go up to 190k and fit in vram. Others, like Deepseek R1 70b can only go up 10k context before it has to spill to CPU. Consider GLM4.7-flash before the memory fix. Using the new default of 256k and maxxing out the GLM4.7's 198k context would have spilled onto CPU and crashed Ollama by default. A safer default would be 32k or 64k (or making sure the context still fits in VRAM) - Tony Diep (He/Him) ________________________________ From: Jesse Gross ***@***.***> Sent: February 4, 2026 4:55 PM To: ollama/ollama ***@***.***> Cc: Tony Diep ***@***.***>; Author ***@***.***> Subject: Re: [ollama/ollama] New default context lengths will break (Issue #14073) [https://avatars.githubusercontent.com/u/6468499?s=20&v=4]jessegross left a comment (ollama/ollama#14073)<https://github.com/ollama/ollama/issues/14073#issuecomment-3849947566> glm-ocr should fit easily into that GPU at max context length: NAME ID SIZE PROCESSOR CONTEXT UNTIL glm-ocr:latest 6effedd0dc8a 15 GB 100% GPU 131072 4 minutes from now Please post the server logs so we can see what is happening. — Reply to this email directly, view it on GitHub<https://github.com/ollama/ollama/issues/14073#issuecomment-3849947566>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAFMF5I5Z55JDHWKOUTVHLL4KJTGFAVCNFSM6AAAAACT7UI3GOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTQNBZHE2DONJWGY>. You are receiving this because you authored the thread.Message ID: ***@***.***>
Author
Owner

@jessegross commented on GitHub (Feb 4, 2026):

glm-4.7-flash will fit perfectly on your GPU:

NAME                    ID              SIZE     PROCESSOR    CONTEXT    UNTIL              
glm-4.7-flash:latest    d1a8a26252f1    40 GB    100% GPU     202752     4 minutes from now    

Before this change, you would have gotten a 4k context window, which is difficult to use and surprising for most use cases.

Yes, a 43G model like deepseek-r1:70b will not leave a lot of room for context length on the GPU. However, it should not crash - simply get slower as more runs on the CPU.

There are no perfect defaults for all models and hardware configurations. Dynamically sizing based on available VRAM is also problematic as the model's quality will vary depending on what else is running on the computer.

Over time, we want the context length to be the full length that the model was trained on and performance to only be impacted as you actually use more of it. This isn't that but it helps a lot of users with more realistic context lengths while keeping results fairly deterministic.

<!-- gh-comment-id:3850096111 --> @jessegross commented on GitHub (Feb 4, 2026): glm-4.7-flash will fit perfectly on your GPU: ``` NAME ID SIZE PROCESSOR CONTEXT UNTIL glm-4.7-flash:latest d1a8a26252f1 40 GB 100% GPU 202752 4 minutes from now ``` Before this change, you would have gotten a 4k context window, which is difficult to use and surprising for most use cases. Yes, a 43G model like deepseek-r1:70b will not leave a lot of room for context length on the GPU. However, it should not crash - simply get slower as more runs on the CPU. There are no perfect defaults for all models and hardware configurations. Dynamically sizing based on available VRAM is also problematic as the model's quality will vary depending on what else is running on the computer. Over time, we want the context length to be the full length that the model was trained on and performance to only be impacted as you actually use more of it. This isn't that but it helps a lot of users with more realistic context lengths while keeping results fairly deterministic.
Author
Owner

@rick-github commented on GitHub (Feb 4, 2026):

The crash the OP experiences is:

ollama  | //ml/backend/ggml/ggml/src/ggml-cuda/cpy.cu:396: GGML_ASSERT(ggml_nbytes(src0) <= INT_MAX) failed

This happens to other models that are pushed to their maximum context, eg nemotron-3-nano:30b and ministral-3.

<!-- gh-comment-id:3850265445 --> @rick-github commented on GitHub (Feb 4, 2026): The crash the OP experiences is: ``` ollama | //ml/backend/ggml/ggml/src/ggml-cuda/cpy.cu:396: GGML_ASSERT(ggml_nbytes(src0) <= INT_MAX) failed ``` This happens to other models that are pushed to their maximum context, eg nemotron-3-nano:30b and [ministral-3](https://github.com/ollama/ollama/issues/13887).
Author
Owner

@tonydiep commented on GitHub (Feb 4, 2026):

glm-4.7-flash will fit perfectly on your GPU:

NAME                    ID              SIZE     PROCESSOR    CONTEXT    UNTIL              
glm-4.7-flash:latest    d1a8a26252f1    40 GB    100% GPU     202752     4 minutes from now    

Before this change, you would have gotten a 4k context window, which is difficult to use and surprising for most use cases.

Yes, a 43G model like deepseek-r1:70b will not leave a lot of room for context length on the GPU. However, it should not crash - simply get slower as more runs on the CPU.

There are no perfect defaults for all models and hardware configurations. Dynamically sizing based on available VRAM is also problematic as the model's quality will vary depending on what else is running on the computer.

Over time, we want the context length to be the full length that the model was trained on and performance to only be impacted as you actually use more of it. This isn't that but it helps a lot of users with more realistic context lengths while keeping results fairly deterministic.

Not really sure why you're telling people what they're seeing with their own eyes doesn't match what you think they should have seen or why you're using context size math from a different build of Ollama.

What I'm reporting is that a default 256k context window means I won't be able to choose Ollama as the inference engine. If the decision is won'tt-fix or not-a-bug then go ahead and close it and we can cross Ollama off the list.

<!-- gh-comment-id:3850324974 --> @tonydiep commented on GitHub (Feb 4, 2026): > glm-4.7-flash will fit perfectly on your GPU: > > ``` > NAME ID SIZE PROCESSOR CONTEXT UNTIL > glm-4.7-flash:latest d1a8a26252f1 40 GB 100% GPU 202752 4 minutes from now > ``` > > Before this change, you would have gotten a 4k context window, which is difficult to use and surprising for most use cases. > > Yes, a 43G model like deepseek-r1:70b will not leave a lot of room for context length on the GPU. However, it should not crash - simply get slower as more runs on the CPU. > > There are no perfect defaults for all models and hardware configurations. Dynamically sizing based on available VRAM is also problematic as the model's quality will vary depending on what else is running on the computer. > > Over time, we want the context length to be the full length that the model was trained on and performance to only be impacted as you actually use more of it. This isn't that but it helps a lot of users with more realistic context lengths while keeping results fairly deterministic. Not really sure why you're telling people what they're seeing with their own eyes doesn't match what you think they should have seen or why you're using context size math from a different build of Ollama. What I'm reporting is that a default 256k context window means I won't be able to choose Ollama as the inference engine. If the decision is won'tt-fix or not-a-bug then go ahead and close it and we can cross Ollama off the list.
Author
Owner

@jessegross commented on GitHub (Feb 5, 2026):

Please post logs as requested.

Rick has identified the likely cause of @illusdolphin's issue. It's both platform dependent and not related to VRAM, other than the fact that the context length is set based on VRAM.

It's not clear that your issue is the same. The sizes I posted are from the current source of Ollama and they suggest that the issue is not necessarily what you think it is or at least a more narrow set of cases. But it's hard to say without the logs.

<!-- gh-comment-id:3850443849 --> @jessegross commented on GitHub (Feb 5, 2026): Please post logs as requested. Rick has identified the likely cause of @illusdolphin's issue. It's both platform dependent and not related to VRAM, other than the fact that the context length is set based on VRAM. It's not clear that your issue is the same. The sizes I posted are from the current source of Ollama and they suggest that the issue is not necessarily what you think it is or at least a more narrow set of cases. But it's hard to say without the logs.
Author
Owner

@rick-github commented on GitHub (Feb 5, 2026):

A wrinkle here, and possibly the cause of the behaviour that tonydiep is seeing, is that the new tiered defaults don't account for OLLAMA_NUM_PARALLEL.

<!-- gh-comment-id:3854398100 --> @rick-github commented on GitHub (Feb 5, 2026): A wrinkle here, and possibly the cause of the behaviour that tonydiep is seeing, is that the new tiered defaults don't account for `OLLAMA_NUM_PARALLEL`.
Author
Owner

@tonydiep commented on GitHub (Feb 6, 2026):

Models which ran on 0.15.4 do not run on 0.15.5 because of new default context size of 256k

Ollama will now default to the following context lengths based on VRAM:
    < 24 GiB VRAM: 4,096 context
    24-48 GiB VRAM: 32,768 context
    >= 48 GiB VRAM: 262,144 context

with default context size set by 0.15.5, ollama crashes

tonydiep@tiny:/LLMs$ ollama --version
ollama version is 0.15.5
tonydiep@tiny:
/LLMs$ ollama run deepseek-r1:70b
Error: 500 Internal Server Error: model requires more system memory (74.0 GiB) than is available (56.7 GiB)

with default context size set by 0.15.4, or by setting context size to 10k to fit my vram:

tonydiep@tiny:~/LLMs$ ollama run deepseek-r1-70b-custom:latest

hello
Hello! How can I assist you today? 😊

For people evaluating Ollama vs other inference engines, it looks like other inference engines can run models that Ollama cannot.

<!-- gh-comment-id:3862081045 --> @tonydiep commented on GitHub (Feb 6, 2026): Models which ran on 0.15.4 do not run on 0.15.5 because of new default context size of 256k ``` Ollama will now default to the following context lengths based on VRAM: < 24 GiB VRAM: 4,096 context 24-48 GiB VRAM: 32,768 context >= 48 GiB VRAM: 262,144 context ``` # with default context size set by 0.15.5, ollama crashes tonydiep@tiny:~/LLMs$ ollama --version ollama version is 0.15.5 tonydiep@tiny:~/LLMs$ ollama run deepseek-r1:70b Error: 500 Internal Server Error: model requires more system memory (74.0 GiB) than is available (56.7 GiB) # with default context size set by 0.15.4, or by setting context size to 10k to fit my vram: tonydiep@tiny:~/LLMs$ ollama run deepseek-r1-70b-custom:latest >>> hello Hello! How can I assist you today? 😊 For people evaluating Ollama vs other inference engines, it looks like other inference engines can run models that Ollama cannot.
Author
Owner

@tonydiep commented on GitHub (Feb 7, 2026):

llama3.3:70b also stopped working with ollama 0.15.5

tonydiep@tiny:/LLMs$ ollama --version
ollama version is 0.15.5
tonydiep@tiny:
/LLMs$ ollama run llama3.3:70b
Error: 500 Internal Server Error: model requires more system memory (74.0 GiB) than is available (56.7 GiB)

<!-- gh-comment-id:3863508113 --> @tonydiep commented on GitHub (Feb 7, 2026): llama3.3:70b also stopped working with ollama 0.15.5 tonydiep@tiny:~/LLMs$ ollama --version ollama version is 0.15.5 tonydiep@tiny:~/LLMs$ ollama run llama3.3:70b Error: 500 Internal Server Error: model requires more system memory (74.0 GiB) than is available (56.7 GiB)
Author
Owner

@tonydiep commented on GitHub (Feb 8, 2026):

Code that uses Ollama worked in 0.15.4 no longer works

ollama version is 0.15.6

Error calling Ollama: an error was encountered while running the model: CUDA error: the launch timed out and was terminated
current device: 2, in function ggml_backend_cuda_synchronize at //ml/backend/ggml/ggml/src/ggml-cuda/ggml-cuda.cu:2981
cudaStreamSynchronize(cuda_ctx->stream())
//ml/backend/ggml/ggml/src/ggml-cuda/ggml-cuda.cu:94: CUDA error (status code: 500)

<!-- gh-comment-id:3868559360 --> @tonydiep commented on GitHub (Feb 8, 2026): Code that uses Ollama worked in 0.15.4 no longer works ollama version is 0.15.6 Error calling Ollama: an error was encountered while running the model: CUDA error: the launch timed out and was terminated current device: 2, in function ggml_backend_cuda_synchronize at //ml/backend/ggml/ggml/src/ggml-cuda/ggml-cuda.cu:2981 cudaStreamSynchronize(cuda_ctx->stream()) //ml/backend/ggml/ggml/src/ggml-cuda/ggml-cuda.cu:94: CUDA error (status code: 500)
Author
Owner

@rick-github commented on GitHub (Feb 8, 2026):

What model?

<!-- gh-comment-id:3868563556 --> @rick-github commented on GitHub (Feb 8, 2026): What model?
Author
Owner

@tonydiep commented on GitHub (Feb 9, 2026):

The model is deepseek-r1-70b but customized to have a context size of 10,000 so it fits in vram. deepseek-r1-70b with default 256k context size does not start.

The model with 10k context runs in ollama cli,

tonydiep@tiny:/Jobs$ ollama --version
ollama version is 0.15.6
tonydiep@tiny:
/Jobs$ ollama run deepseek-r1-70b-custom:latest

How large is your context size right now?
My context size is approximately 131,000 tokens. This means I can process and respond to text inputs of that length. If you have any specific
questions or need assistance with something, feel free to ask!

... but the same model breaks if run via Python with the following error:

Error calling Ollama: an error was encountered while running the model: CUDA error: the launch timed out and was terminated
current device: 2, in function ggml_backend_cuda_synchronize at //ml/backend/ggml/ggml/src/ggml-cuda/ggml-cuda.cu:2981
cudaStreamSynchronize(cuda_ctx->stream())
//ml/backend/ggml/ggml/src/ggml-cuda/ggml-cuda.cu:94: CUDA error (status code: 500)

The model worked when used in Python with Ollama 0.15.4

<!-- gh-comment-id:3868729170 --> @tonydiep commented on GitHub (Feb 9, 2026): The model is deepseek-r1-70b but customized to have a context size of 10,000 so it fits in vram. deepseek-r1-70b with default 256k context size does not start. The model with 10k context runs in ollama cli, tonydiep@tiny:~/Jobs$ ollama --version ollama version is 0.15.6 tonydiep@tiny:~/Jobs$ ollama run deepseek-r1-70b-custom:latest >>> How large is your context size right now? My context size is approximately **131,000 tokens**. This means I can process and respond to text inputs of that length. If you have any specific questions or need assistance with something, feel free to ask! ... but the same model breaks if run via Python with the following error: Error calling Ollama: an error was encountered while running the model: CUDA error: the launch timed out and was terminated current device: 2, in function ggml_backend_cuda_synchronize at //ml/backend/ggml/ggml/src/ggml-cuda/ggml-cuda.cu:2981 cudaStreamSynchronize(cuda_ctx->stream()) //ml/backend/ggml/ggml/src/ggml-cuda/ggml-cuda.cu:94: CUDA error (status code: 500) The model worked when used in Python with Ollama 0.15.4
Author
Owner

@rick-github commented on GitHub (Feb 9, 2026):

Can you provide server logs and a minimal repro with python code?

#!/usr/bin/env python3

import ollama

model="deepseek-r1-70b-custom"

response = ollama.chat(
	model=model,
	messages=[
		{"role":"user","content":"hello"}
	]
)
print(response.message.content)
$ ollama -v
ollama version is 0.15.6
$ python3 14073.py
Hello! How can I assist you today? 😊
<!-- gh-comment-id:3868761232 --> @rick-github commented on GitHub (Feb 9, 2026): Can you provide server logs and a minimal repro with python code? ```python #!/usr/bin/env python3 import ollama model="deepseek-r1-70b-custom" response = ollama.chat( model=model, messages=[ {"role":"user","content":"hello"} ] ) print(response.message.content) ``` ```console $ ollama -v ollama version is 0.15.6 $ python3 14073.py Hello! How can I assist you today? 😊 ```
Author
Owner

@tonydiep commented on GitHub (Feb 9, 2026):

You're right. The minimal hello-world worked and it respected the 10k context length. Thanks!

Feb 08 20:11:45 tiny ollama[9434]: print_info: general.name = DeepSeek R1 Distill Llama 70B
Feb 08 20:11:45 tiny ollama[9434]: print_info: vocab type = BPE
Feb 08 20:11:45 tiny ollama[9434]: print_info: n_vocab = 128256
Feb 08 20:11:45 tiny ollama[9434]: print_info: n_merges = 280147
Feb 08 20:11:45 tiny ollama[9434]: print_info: BOS token = 128000 '<|begin▁of▁sentence|>'
Feb 08 20:11:45 tiny ollama[9434]: print_info: EOS token = 128001 '<|end▁of▁sentence|>'
Feb 08 20:11:45 tiny ollama[9434]: print_info: EOT token = 128009 '<|eot_id|>'
Feb 08 20:11:45 tiny ollama[9434]: print_info: EOM token = 128008 '<|eom_id|>'
Feb 08 20:11:45 tiny ollama[9434]: print_info: PAD token = 128001 '<|end▁of▁sentence|>'
Feb 08 20:11:45 tiny ollama[9434]: print_info: LF token = 198 'Ċ'
Feb 08 20:11:45 tiny ollama[9434]: print_info: EOG token = 128001 '<|end▁of▁sentence|>'
Feb 08 20:11:45 tiny ollama[9434]: print_info: EOG token = 128008 '<|eom_id|>'
Feb 08 20:11:45 tiny ollama[9434]: print_info: EOG token = 128009 '<|eot_id|>'
Feb 08 20:11:45 tiny ollama[9434]: print_info: max token length = 256
Feb 08 20:11:45 tiny ollama[9434]: load_tensors: loading model tensors, this can take a while... (mmap = true)
Feb 08 20:11:45 tiny ollama[9434]: load_tensors: offloading 80 repeating layers to GPU
Feb 08 20:11:45 tiny ollama[9434]: load_tensors: offloading output layer to GPU
Feb 08 20:11:45 tiny ollama[9434]: load_tensors: offloaded 81/81 layers to GPU
Feb 08 20:11:45 tiny ollama[9434]: load_tensors: CPU_Mapped model buffer size = 563.62 MiB
Feb 08 20:11:45 tiny ollama[9434]: load_tensors: CUDA0 model buffer size = 20038.81 MiB
Feb 08 20:11:45 tiny ollama[9434]: load_tensors: CUDA1 model buffer size = 11512.00 MiB
Feb 08 20:11:45 tiny ollama[9434]: load_tensors: CUDA2 model buffer size = 8428.67 MiB
Feb 08 20:11:54 tiny ollama[9434]: llama_context: constructing llama_context
Feb 08 20:11:54 tiny ollama[9434]: llama_context: n_seq_max = 1
Feb 08 20:11:54 tiny ollama[9434]: llama_context: n_ctx = 10240
Feb 08 20:11:54 tiny ollama[9434]: llama_context: n_ctx_seq = 10240
Feb 08 20:11:54 tiny ollama[9434]: llama_context: n_batch = 512
Feb 08 20:11:54 tiny ollama[9434]: llama_context: n_ubatch = 512
Feb 08 20:11:54 tiny ollama[9434]: llama_context: causal_attn = 1
Feb 08 20:11:54 tiny ollama[9434]: llama_context: flash_attn = auto
Feb 08 20:11:54 tiny ollama[9434]: llama_context: kv_unified = false
Feb 08 20:11:54 tiny ollama[9434]: llama_context: freq_base = 500000.0
Feb 08 20:11:54 tiny ollama[9434]: llama_context: freq_scale = 1
Feb 08 20:11:54 tiny ollama[9434]: llama_context: n_ctx_seq (10240) < n_ctx_train (131072) -- the full capacity of the model will not be utilized
Feb 08 20:11:54 tiny ollama[9434]: llama_context: CUDA_Host output buffer size = 0.52 MiB
Feb 08 20:11:54 tiny ollama[9434]: llama_kv_cache: CUDA0 KV buffer size = 1640.00 MiB
Feb 08 20:11:54 tiny ollama[9434]: llama_kv_cache: CUDA1 KV buffer size = 960.00 MiB
Feb 08 20:11:54 tiny ollama[9434]: llama_kv_cache: CUDA2 KV buffer size = 600.00 MiB
Feb 08 20:11:54 tiny ollama[9434]: llama_kv_cache: size = 3200.00 MiB ( 10240 cells, 80 layers, 1/1 seqs), K (f16): 1600.00 MiB, V (f16): 1600.00 MiB
Feb 08 20:11:54 tiny ollama[9434]: llama_context: pipeline parallelism enabled (n_copies=4)
Feb 08 20:11:54 tiny ollama[9434]: llama_context: Flash Attention was auto, set to enabled
Feb 08 20:11:55 tiny ollama[9434]: llama_context: CUDA0 compute buffer size = 370.04 MiB
Feb 08 20:11:55 tiny ollama[9434]: llama_context: CUDA1 compute buffer size = 320.04 MiB
Feb 08 20:11:55 tiny ollama[9434]: llama_context: CUDA2 compute buffer size = 370.55 MiB
Feb 08 20:11:55 tiny ollama[9434]: llama_context: CUDA_Host compute buffer size = 96.05 MiB
Feb 08 20:11:55 tiny ollama[9434]: llama_context: graph nodes = 2487
Feb 08 20:11:55 tiny ollama[9434]: llama_context: graph splits = 4
Feb 08 20:11:55 tiny ollama[9434]: time=2026-02-08T20:11:55.076-05:00 level=INFO source=server.go:1388 msg="llama runner started in 14.68 seconds"
Feb 08 20:11:55 tiny ollama[9434]: time=2026-02-08T20:11:55.076-05:00 level=INFO source=sched.go:537 msg="loaded runners" count=1
Feb 08 20:11:55 tiny ollama[9434]: time=2026-02-08T20:11:55.076-05:00 level=INFO source=server.go:1350 msg="waiting for llama runner to start responding"
Feb 08 20:11:55 tiny ollama[9434]: time=2026-02-08T20:11:55.077-05:00 level=INFO source=server.go:1388 msg="llama runner started in 14.68 seconds"
Feb 08 20:12:02 tiny ollama[9434]: [GIN] 2026/02/08 - 20:12:02 | 200 | 22.659538687s | 127.0.0.1 | POST "/api/chat"
(venv) tonydiep@tiny:~/Projects/test-ollama$

<!-- gh-comment-id:3868810934 --> @tonydiep commented on GitHub (Feb 9, 2026): You're right. The minimal hello-world worked and it respected the 10k context length. Thanks! Feb 08 20:11:45 tiny ollama[9434]: print_info: general.name = DeepSeek R1 Distill Llama 70B Feb 08 20:11:45 tiny ollama[9434]: print_info: vocab type = BPE Feb 08 20:11:45 tiny ollama[9434]: print_info: n_vocab = 128256 Feb 08 20:11:45 tiny ollama[9434]: print_info: n_merges = 280147 Feb 08 20:11:45 tiny ollama[9434]: print_info: BOS token = 128000 '<|begin▁of▁sentence|>' Feb 08 20:11:45 tiny ollama[9434]: print_info: EOS token = 128001 '<|end▁of▁sentence|>' Feb 08 20:11:45 tiny ollama[9434]: print_info: EOT token = 128009 '<|eot_id|>' Feb 08 20:11:45 tiny ollama[9434]: print_info: EOM token = 128008 '<|eom_id|>' Feb 08 20:11:45 tiny ollama[9434]: print_info: PAD token = 128001 '<|end▁of▁sentence|>' Feb 08 20:11:45 tiny ollama[9434]: print_info: LF token = 198 'Ċ' Feb 08 20:11:45 tiny ollama[9434]: print_info: EOG token = 128001 '<|end▁of▁sentence|>' Feb 08 20:11:45 tiny ollama[9434]: print_info: EOG token = 128008 '<|eom_id|>' Feb 08 20:11:45 tiny ollama[9434]: print_info: EOG token = 128009 '<|eot_id|>' Feb 08 20:11:45 tiny ollama[9434]: print_info: max token length = 256 Feb 08 20:11:45 tiny ollama[9434]: load_tensors: loading model tensors, this can take a while... (mmap = true) Feb 08 20:11:45 tiny ollama[9434]: load_tensors: offloading 80 repeating layers to GPU Feb 08 20:11:45 tiny ollama[9434]: load_tensors: offloading output layer to GPU Feb 08 20:11:45 tiny ollama[9434]: load_tensors: offloaded 81/81 layers to GPU Feb 08 20:11:45 tiny ollama[9434]: load_tensors: CPU_Mapped model buffer size = 563.62 MiB Feb 08 20:11:45 tiny ollama[9434]: load_tensors: CUDA0 model buffer size = 20038.81 MiB Feb 08 20:11:45 tiny ollama[9434]: load_tensors: CUDA1 model buffer size = 11512.00 MiB Feb 08 20:11:45 tiny ollama[9434]: load_tensors: CUDA2 model buffer size = 8428.67 MiB Feb 08 20:11:54 tiny ollama[9434]: llama_context: constructing llama_context Feb 08 20:11:54 tiny ollama[9434]: llama_context: n_seq_max = 1 Feb 08 20:11:54 tiny ollama[9434]: llama_context: n_ctx = 10240 Feb 08 20:11:54 tiny ollama[9434]: llama_context: n_ctx_seq = 10240 Feb 08 20:11:54 tiny ollama[9434]: llama_context: n_batch = 512 Feb 08 20:11:54 tiny ollama[9434]: llama_context: n_ubatch = 512 Feb 08 20:11:54 tiny ollama[9434]: llama_context: causal_attn = 1 Feb 08 20:11:54 tiny ollama[9434]: llama_context: flash_attn = auto Feb 08 20:11:54 tiny ollama[9434]: llama_context: kv_unified = false Feb 08 20:11:54 tiny ollama[9434]: llama_context: freq_base = 500000.0 Feb 08 20:11:54 tiny ollama[9434]: llama_context: freq_scale = 1 Feb 08 20:11:54 tiny ollama[9434]: llama_context: n_ctx_seq (10240) < n_ctx_train (131072) -- the full capacity of the model will not be utilized Feb 08 20:11:54 tiny ollama[9434]: llama_context: CUDA_Host output buffer size = 0.52 MiB Feb 08 20:11:54 tiny ollama[9434]: llama_kv_cache: CUDA0 KV buffer size = 1640.00 MiB Feb 08 20:11:54 tiny ollama[9434]: llama_kv_cache: CUDA1 KV buffer size = 960.00 MiB Feb 08 20:11:54 tiny ollama[9434]: llama_kv_cache: CUDA2 KV buffer size = 600.00 MiB Feb 08 20:11:54 tiny ollama[9434]: llama_kv_cache: size = 3200.00 MiB ( 10240 cells, 80 layers, 1/1 seqs), K (f16): 1600.00 MiB, V (f16): 1600.00 MiB Feb 08 20:11:54 tiny ollama[9434]: llama_context: pipeline parallelism enabled (n_copies=4) Feb 08 20:11:54 tiny ollama[9434]: llama_context: Flash Attention was auto, set to enabled Feb 08 20:11:55 tiny ollama[9434]: llama_context: CUDA0 compute buffer size = 370.04 MiB Feb 08 20:11:55 tiny ollama[9434]: llama_context: CUDA1 compute buffer size = 320.04 MiB Feb 08 20:11:55 tiny ollama[9434]: llama_context: CUDA2 compute buffer size = 370.55 MiB Feb 08 20:11:55 tiny ollama[9434]: llama_context: CUDA_Host compute buffer size = 96.05 MiB Feb 08 20:11:55 tiny ollama[9434]: llama_context: graph nodes = 2487 Feb 08 20:11:55 tiny ollama[9434]: llama_context: graph splits = 4 Feb 08 20:11:55 tiny ollama[9434]: time=2026-02-08T20:11:55.076-05:00 level=INFO source=server.go:1388 msg="llama runner started in 14.68 seconds" Feb 08 20:11:55 tiny ollama[9434]: time=2026-02-08T20:11:55.076-05:00 level=INFO source=sched.go:537 msg="loaded runners" count=1 Feb 08 20:11:55 tiny ollama[9434]: time=2026-02-08T20:11:55.076-05:00 level=INFO source=server.go:1350 msg="waiting for llama runner to start responding" Feb 08 20:11:55 tiny ollama[9434]: time=2026-02-08T20:11:55.077-05:00 level=INFO source=server.go:1388 msg="llama runner started in 14.68 seconds" Feb 08 20:12:02 tiny ollama[9434]: [GIN] 2026/02/08 - 20:12:02 | 200 | 22.659538687s | 127.0.0.1 | POST "/api/chat" (venv) tonydiep@tiny:~/Projects/test-ollama$
Author
Owner

@rick-github commented on GitHub (Feb 9, 2026):

Can you provide the logs from a failure?

<!-- gh-comment-id:3868814227 --> @rick-github commented on GitHub (Feb 9, 2026): Can you provide the logs from a failure?
Author
Owner

@tonydiep commented on GitHub (Feb 9, 2026):

Here's the one where it's loading deepseek-r1-70b but giving it 10k context instead of default so that it fits in vram. It fails.

ollama_crash1_deepseek.txt

<!-- gh-comment-id:3872976770 --> @tonydiep commented on GitHub (Feb 9, 2026): Here's the one where it's loading deepseek-r1-70b but giving it 10k context instead of default so that it fits in vram. It fails. [ollama_crash1_deepseek.txt](https://github.com/user-attachments/files/25189433/ollama_crash1_deepseek.txt)
Author
Owner

@tonydiep commented on GitHub (Feb 9, 2026):

Qwen3-coder-next also crashes with default context size but that was expected.

ollama_crash2_memory.txt

<!-- gh-comment-id:3873049427 --> @tonydiep commented on GitHub (Feb 9, 2026): Qwen3-coder-next also crashes with default context size but that was expected. [ollama_crash2_memory.txt](https://github.com/user-attachments/files/25189737/ollama_crash2_memory.txt)
Author
Owner

@tonydiep commented on GitHub (Feb 10, 2026):

If Ollama won't reduce its default context size, can we have a parameter like llama.cpp's -c to specify a context size when running a model?

It's ridiculous Ollama can't run models that llama.cpp or LocalAI can with 64G system ram + 64G vram, not even to set a smaller context size.

tonydiep@tiny:~$ nvidia-smi
Tue Feb 10 12:17:36 2026
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 580.126.16 Driver Version: 580.126.16 CUDA Version: 13.0 |
+-----------------------------------------+------------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+========================+======================|
| 0 NVIDIA GeForce RTX 5060 Ti On | 00000000:01:00.0 Off | N/A |
| 0% 35C P8 9W / 180W | 190MiB / 16311MiB | 0% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+
| 1 NVIDIA GeForce RTX 3090 On | 00000000:02:00.0 Off | N/A |
| 0% 43C P8 15W / 370W | 19863MiB / 24576MiB | 0% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+
| 2 NVIDIA GeForce RTX 3090 On | 00000000:04:00.0 Off | N/A |
| 0% 37C P8 15W / 350W | 19847MiB / 24576MiB | 0% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+

tonydiep@tiny:~$ free -h
total used free shared buff/cache available
Mem: 62Gi 9.1Gi 27Gi 100Mi 26Gi 53Gi

tonydiep@tiny:$ ollama --version
ollama version is 0.15.6
tonydiep@tiny:
$ ollama run deepseek-r1:70b
Error: 500 Internal Server Error: model requires more system memory (70.0 GiB) than is available (53.2 GiB)
tonydiep@tiny:$ ollama run llama3.3:70b
Error: 500 Internal Server Error: model requires more system memory (70.0 GiB) than is available (53.1 GiB)
tonydiep@tiny:
$ ollama run qwen3-next:80b
Error: 500 Internal Server Error: model requires more system memory (70.7 GiB) than is available (53.1 GiB)

<!-- gh-comment-id:3879653347 --> @tonydiep commented on GitHub (Feb 10, 2026): If Ollama won't reduce its default context size, can we have a parameter like llama.cpp's -c to specify a context size when running a model? It's ridiculous Ollama can't run models that llama.cpp or LocalAI can with 64G system ram + 64G vram, not even to set a smaller context size. tonydiep@tiny:~$ nvidia-smi Tue Feb 10 12:17:36 2026 +-----------------------------------------------------------------------------------------+ | NVIDIA-SMI 580.126.16 Driver Version: 580.126.16 CUDA Version: 13.0 | +-----------------------------------------+------------------------+----------------------+ | GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |=========================================+========================+======================| | 0 NVIDIA GeForce RTX 5060 Ti On | 00000000:01:00.0 Off | N/A | | 0% 35C P8 9W / 180W | 190MiB / 16311MiB | 0% Default | | | | N/A | +-----------------------------------------+------------------------+----------------------+ | 1 NVIDIA GeForce RTX 3090 On | 00000000:02:00.0 Off | N/A | | 0% 43C P8 15W / 370W | 19863MiB / 24576MiB | 0% Default | | | | N/A | +-----------------------------------------+------------------------+----------------------+ | 2 NVIDIA GeForce RTX 3090 On | 00000000:04:00.0 Off | N/A | | 0% 37C P8 15W / 350W | 19847MiB / 24576MiB | 0% Default | | | | N/A | +-----------------------------------------+------------------------+----------------------+ tonydiep@tiny:~$ free -h total used free shared buff/cache available Mem: 62Gi 9.1Gi 27Gi 100Mi 26Gi 53Gi tonydiep@tiny:~$ ollama --version ollama version is 0.15.6 tonydiep@tiny:~$ ollama run deepseek-r1:70b Error: 500 Internal Server Error: model requires more system memory (70.0 GiB) than is available (53.2 GiB) tonydiep@tiny:~$ ollama run llama3.3:70b Error: 500 Internal Server Error: model requires more system memory (70.0 GiB) than is available (53.1 GiB) tonydiep@tiny:~$ ollama run qwen3-next:80b Error: 500 Internal Server Error: model requires more system memory (70.7 GiB) than is available (53.1 GiB)
Author
Owner

@rick-github commented on GitHub (Feb 10, 2026):

If OLLAMA_CONTEXT_LENGTH is set to 4096 in the server environment then the server will act exactly as it did before the context scaling was added.

<!-- gh-comment-id:3879793357 --> @rick-github commented on GitHub (Feb 10, 2026): If `OLLAMA_CONTEXT_LENGTH` is set to 4096 in the server environment then the server will act exactly as it did before the context scaling was added.
Author
Owner

@tonydiep commented on GitHub (Feb 10, 2026):

I already had OLLAMA_CONTEXT_LENGTH set for a known size that worked with deepseek-r1-70b but I'll try 4096

declare -x OLLAMA_CONTEXT_LENGTH="10000"
declare -x OLLAMA_FLASH_ATTENTION="1"

<!-- gh-comment-id:3879996166 --> @tonydiep commented on GitHub (Feb 10, 2026): I already had OLLAMA_CONTEXT_LENGTH set for a known size that worked with deepseek-r1-70b but I'll try 4096 declare -x OLLAMA_CONTEXT_LENGTH="10000" declare -x OLLAMA_FLASH_ATTENTION="1"
Author
Owner

@NAPTiON commented on GitHub (Feb 23, 2026):

"I can confirm that this issue is related to the increased default context lengths in 0.15.5. To mitigate this, you may want to consider using locally trained models like Llama 3.2 for categorization, or utilizing launchd for scheduling tasks. Additionally, using JSONL format for persistence could help alleviate some of the memory pressure on your system. You can learn more about my approach to solving similar issues in my writeup at magic.naption.ai/pipeline."

<!-- gh-comment-id:3943978285 --> @NAPTiON commented on GitHub (Feb 23, 2026): "I can confirm that this issue is related to the increased default context lengths in 0.15.5. To mitigate this, you may want to consider using locally trained models like Llama 3.2 for categorization, or utilizing launchd for scheduling tasks. Additionally, using JSONL format for persistence could help alleviate some of the memory pressure on your system. You can learn more about my approach to solving similar issues in my writeup at magic.naption.ai/pipeline."
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#71252