https://github.com/ollama/ollama/issues/2774
To use a larger context window with Ollama models, you can adjust the “num_ctx” parameter, which controls how many tokens the model can consider when generating the next token; by default, this is set to 2048, but you can increase it to accommodate longer prompts or complex tasks requiring more context; however, be aware that a larger context window will consume more memory on your system.
https://www.reddit.com/r/LocalLLaMA/comments/1c2yicn/what_models_have_very_large_context_windows/