Skip to content

Prefer Ollama configured model context length over model architecture context length#53543

Merged
probably-neb merged 1 commit intozed-industries:mainfrom
MarekMalevic:main
Apr 15, 2026
Merged

Prefer Ollama configured model context length over model architecture context length#53543
probably-neb merged 1 commit intozed-industries:mainfrom
MarekMalevic:main

Conversation

@MarekMalevic
Copy link
Copy Markdown
Contributor

@MarekMalevic MarekMalevic commented Apr 9, 2026

Self-Review Checklist:

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content is consistent with the UI/UX checklist
  • Tests cover the new/changed behavior
  • 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

@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Apr 9, 2026

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Marek Malevic.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@zed-codeowner-coordinator zed-codeowner-coordinator Bot requested review from a team, osyvokon and probably-neb and removed request for a team April 9, 2026 18:51
@zed-community-bot zed-community-bot Bot added the first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions label Apr 9, 2026
@MarekMalevic
Copy link
Copy Markdown
Contributor Author

@cla-bot check

@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Apr 9, 2026

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Marek Malevic.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Apr 9, 2026

The cla-bot has been summoned, and re-checked this pull request!

@MarekMalevic MarekMalevic marked this pull request as draft April 9, 2026 19:29
@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Apr 9, 2026

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Marek Malevic.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@MarekMalevic
Copy link
Copy Markdown
Contributor Author

@cla-bot check

@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Apr 9, 2026

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Marek Malevic.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Apr 9, 2026

The cla-bot has been summoned, and re-checked this pull request!

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Apr 9, 2026
@MarekMalevic MarekMalevic reopened this Apr 9, 2026
@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Apr 9, 2026

We require contributors to sign our Contributor License Agreement, and we don't have @MarekMalevic on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@cla-bot cla-bot Bot removed the cla-signed The user has signed the Contributor License Agreement label Apr 9, 2026
@MarekMalevic MarekMalevic marked this pull request as ready for review April 9, 2026 21:16
@zed-codeowner-coordinator zed-codeowner-coordinator Bot requested a review from a team April 9, 2026 21:16
@MarekMalevic
Copy link
Copy Markdown
Contributor Author

@cla-bot check

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Apr 9, 2026
@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Apr 9, 2026

The cla-bot has been summoned, and re-checked this pull request!

Copy link
Copy Markdown
Collaborator

@probably-neb probably-neb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@probably-neb probably-neb merged commit 1a6c2ae into zed-industries:main Apr 15, 2026
43 of 62 checks passed
G36maid pushed a commit to G36maid/zed that referenced this pull request Apr 29, 2026
… context length (zed-industries#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 zed-industries#42340

Release Notes:

- Fix calculation of Ollama model context length
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AI: Ollama uses an unnecessary large context window which fails GPU memory allocations

3 participants