Skip to content
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

add support for Ollama num_gpu #4353

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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 d469933
🔍 Latest deploy log https://app.netlify.com/sites/continuedev/deploys/67bdee85876b3a00085b5f2f
😎 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?

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.

1 participant