Skip to content

Instantly share code, notes, and snippets.

View ochafik's full-sized avatar

Olivier Chafik ochafik

View GitHub Profile
@ochafik
ochafik / get_ollama_gguf.js
Last active March 30, 2025 22:10
Script to get the GGUF file from an Ollama image for use with llama.cpp's llama-server
#!/usr/bin/env node
/*
Gets the file under $OLLAMA_HOME/models/blobs/ for the application/vnd.ollama.image.model key in the manifest
- Note that metadata of modelId:modelTag is stored under $OLLAMA_HOME/models/manifests/registry.ollama.ai/library/${modelId}/${modelTag}
- You'll need to get the Jinja template from the original model using llama.cpp's scripts/get_chat_template.py script
ollama pull qwen2.5-coder:7b
llama-server -m $( ./get_ollama_gguf.js qwen2.5-coder:7b ) -fa --jinja --chat-template-file <( ./scripts/get_chat_template.py Qwen/Qwen2.5-Coder-7B-Instruct-GGUF tool_use )
Initially shared here: https://github.com/ggml-org/llama.cpp/pull/9639#issuecomment-2704208342