Instructions to use TheBloke/CodeLlama-7B-Instruct-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TheBloke/CodeLlama-7B-Instruct-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="TheBloke/CodeLlama-7B-Instruct-GGUF")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("TheBloke/CodeLlama-7B-Instruct-GGUF", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use TheBloke/CodeLlama-7B-Instruct-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf TheBloke/CodeLlama-7B-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf TheBloke/CodeLlama-7B-Instruct-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf TheBloke/CodeLlama-7B-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf TheBloke/CodeLlama-7B-Instruct-GGUF:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf TheBloke/CodeLlama-7B-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf TheBloke/CodeLlama-7B-Instruct-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf TheBloke/CodeLlama-7B-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf TheBloke/CodeLlama-7B-Instruct-GGUF:Q4_K_M
Use Docker
docker model run hf.co/TheBloke/CodeLlama-7B-Instruct-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use TheBloke/CodeLlama-7B-Instruct-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TheBloke/CodeLlama-7B-Instruct-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TheBloke/CodeLlama-7B-Instruct-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/TheBloke/CodeLlama-7B-Instruct-GGUF:Q4_K_M
- SGLang
How to use TheBloke/CodeLlama-7B-Instruct-GGUF with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "TheBloke/CodeLlama-7B-Instruct-GGUF" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TheBloke/CodeLlama-7B-Instruct-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "TheBloke/CodeLlama-7B-Instruct-GGUF" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TheBloke/CodeLlama-7B-Instruct-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use TheBloke/CodeLlama-7B-Instruct-GGUF with Ollama:
ollama run hf.co/TheBloke/CodeLlama-7B-Instruct-GGUF:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use TheBloke/CodeLlama-7B-Instruct-GGUF with Docker Model Runner:
docker model run hf.co/TheBloke/CodeLlama-7B-Instruct-GGUF:Q4_K_M
- Lemonade
How to use TheBloke/CodeLlama-7B-Instruct-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull TheBloke/CodeLlama-7B-Instruct-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.CodeLlama-7B-Instruct-GGUF-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Commit History
-
Update base_model formatting
2f064ee
-
Upload README.md
e13d0c5
-
Upload README.md
fe88951
-
Upload README.md
80b6254 -
Upload README.md
6199080 -
Initial GGUF model commit (model made with llama.cpp commit 2ba85c8)
999cb23 -
Add Llama 2 license files
265f8db -
Initial GGUF model commit (model made with llama.cpp commit 2ba85c8)
f47fee0 -
Initial GGUF model commit (model made with llama.cpp commit 2ba85c8)
01ab883 -
Initial GGUF model commit (model made with llama.cpp commit 2ba85c8)
da65aed -
Initial GGUF model commit (model made with llama.cpp commit 2ba85c8)
18e2e60 -
Initial GGUF model commit (model made with llama.cpp commit 2ba85c8)
3841867 -
Initial GGUF model commit (model made with llama.cpp commit 2ba85c8)
8d53e90 -
Initial GGUF model commit (model made with llama.cpp commit 2ba85c8)
c59fc82 -
Initial GGUF model commit (model made with llama.cpp commit 2ba85c8)
cde36d0 -
Initial GGUF model commit (model made with llama.cpp commit 2ba85c8)
2be6b34 -
Initial GGUF model commit (model made with llama.cpp commit 2ba85c8)
78904c7 -
Initial GGUF model commit (model made with llama.cpp commit 2ba85c8)
5a38c57 -
Initial GGUF model commit (model made with llama.cpp commit 2ba85c8)
84a86e0
-
Initial GGUF model commit
a9b5773 -
Initial GGUF model commit
00ceadf -
Add Llama 2 license files
ee04a3d -
Add Llama 2 license files
45f3d58 -
Add Llama 2 license files
1b7d4fe -
Initial GGUF model commit
5fd0463 -
Add Llama 2 license files
48b17b0 -
Add Llama 2 license files
3de89ea -
Add Llama 2 license files
46bb335 -
Initial GGUF model commit
04a67b0 -
Initial GGUF model commit
d6b2f1d -
Add Llama 2 license files
7928de4 -
Add Llama 2 license files
569ddfa -
Add Llama 2 license files
517fd93
-
Initial GGUF model commit
d4f3efd -
Initial GGUF model commit
3d72bb3 -
Add Llama 2 license files
e782dfc -
Add Llama 2 license files
126e5fa -
Add Llama 2 license files
228a580 -
Initial GGUF model commit
ba8846d -
Initial GGUF model commit
64405a5 -
Add Llama 2 license files
16476ce -
Add Llama 2 license files
c584035 -
Add Llama 2 license files
88930a2 -
Update README.md
7eea1f2 -
Update README.md
388dd0d
-
Initial GGUF model commit
9dbe136 -
Initial GGUF model commit
c4e8572 -
Add Llama 2 license files
e509c66 -
Add Llama 2 license files
d3c7e76 -
Add Llama 2 license files
b010e8e