# Prefer Ollama configured model context length over model architecture context length \(\#53543\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/1a6c2aeeef2e1ef84fadddd9b123ca4a8bb222be)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 1a6c2aeeef2e1ef84fadddd9b123ca4a8bb222be

Requested commit: 1a6c2aeeef2e1ef84fadddd9b123ca4a8bb222be

Commit: 1a6c2aeeef2e1ef84fadddd9b123ca4a8bb222be

Tree: 9bdb5722494dc3f0f2d5f57db74abb72deac83ac

Author: MarekMalevic

Committer: GitHub

## Message

```
Prefer Ollama configured model context length over model architecture context length (#53543)

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Fixes calculation of Ollama model context length. Now prefers num_ctx
model configuration over model architecture context length the same way
Ollama does.

Closes #42340

Release Notes:

- Fix calculation of Ollama model context length
```

## Parents

- [a30bc615e2d00c047a32c9e9ecb412ed704434f9](https://git.cafe/gitcafe/zed/commit/a30bc615e2d00c047a32c9e9ecb412ed704434f9?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/1a6c2aeeef2e1ef84fadddd9b123ca4a8bb222be?format=markdown)
