Skip to content

add support for Ollama num_gpu #4353

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 29, 2025
Merged

Conversation

Fmstrat
Copy link
Contributor

@Fmstrat Fmstrat commented Feb 25, 2025

Description

Added support for Ollama num_gpu. This allows for forcing models to use the GPU in memory limited situations. Modeled after existing Ollama specific options such as keepAlive.

Checklist

  • The relevant docs, if any, have been updated or created
  • The relevant tests, if any, have been updated or created

Testing instructions

Set your config up with numGpu:

    {
      "title": "Qwen2.5 Coder 14B (Ollama)",
      "provider": "ollama",
      "model": "qwen2.5-coder:14b",
      "apiBase": "http://localhost:11434",
      "contextLength": 2048,
      "completionOptions": {
          "maxTokens": 1024,
          "numGpu": 1000
      },
      "keepAlive": 0
    },

Watch is pass through to Ollama via the Ollama logs (--n-gpu-layers 1000):

level=INFO source=server.go:376 msg="starting llama server" cmd="/usr/lib/ollama/runners/cuda_v12_avx/ollama_llama_server runner --model /root/.ollama/models/blobs/sha256-ac9bc7a69dab38da1c790838955f1293420b55ab555ef6b4615efa1c1507b1ed --ctx-size 2048 --batch-size 512 --n-gpu-layers 1000 --threads 8 --no-mmap --parallel 1 --tensor-split 35,13 --port 33783"

Copy link

netlify bot commented Feb 25, 2025

Deploy Preview for continuedev ready!

Name Link
🔨 Latest commit abfd726
🔍 Latest deploy log https://app.netlify.com/sites/continuedev/deploys/68112810d5363400088fe068
😎 Deploy Preview https://deploy-preview-4353--continuedev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Fmstrat
Copy link
Contributor Author

Fmstrat commented Feb 25, 2025

I think this is failing due to an unrelated timeout?

@warcow105
Copy link

This is a welcome addition. It will allow the use of larger models or deeper context without forcing those changes on all of the models.

sestinj
sestinj previously approved these changes Apr 29, 2025
@sestinj sestinj requested a review from a team as a code owner April 29, 2025 19:27
@sestinj sestinj requested review from tomasz-stefaniak and removed request for a team April 29, 2025 19:27
@sestinj sestinj merged commit ffd0e9c into continuedev:main Apr 29, 2025
32 checks passed
@sestinj
Copy link
Contributor

sestinj commented May 15, 2025

Hi @Fmstrat, yesterday we shared some updates with our contributors about how we're aiming to improve the contribution process. Part of this included the addition of a Contributor License Agreement (CLA) to protect both contributors and the project. We're reaching out to ask that previous contributors sign it.

Could you please take a moment to sign, or if you have any questions send me a message? (either here or nate@continue.dev would work)

To do so, you just need to post a comment below with the following text:

I have read the CLA Document and I hereby sign the CLA

❤️ Thank you for the work you've done on Continue, and let me know if you have any suggestions on how we can make the project even better!

Copy link


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


1 out of 2 committers have signed the CLA.
✅ (sestinj)[https://github.com/sestinj]
@Fmstrat
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants