Instructions to use TheBloke/CodeLlama-7B-Python-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TheBloke/CodeLlama-7B-Python-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="TheBloke/CodeLlama-7B-Python-GGUF")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("TheBloke/CodeLlama-7B-Python-GGUF", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use TheBloke/CodeLlama-7B-Python-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-Python-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf TheBloke/CodeLlama-7B-Python-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-Python-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf TheBloke/CodeLlama-7B-Python-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf TheBloke/CodeLlama-7B-Python-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf TheBloke/CodeLlama-7B-Python-GGUF:Q4_K_M
Use Docker
docker model run hf.co/TheBloke/CodeLlama-7B-Python-GGUF:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use TheBloke/CodeLlama-7B-Python-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-Python-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-Python-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/TheBloke/CodeLlama-7B-Python-GGUF:Q4_K_M
- SGLang
How to use TheBloke/CodeLlama-7B-Python-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-Python-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-Python-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-Python-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-Python-GGUF", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use TheBloke/CodeLlama-7B-Python-GGUF with Ollama:
ollama run hf.co/TheBloke/CodeLlama-7B-Python-GGUF:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use TheBloke/CodeLlama-7B-Python-GGUF with Docker Model Runner:
docker model run hf.co/TheBloke/CodeLlama-7B-Python-GGUF:Q4_K_M
- Lemonade
How to use TheBloke/CodeLlama-7B-Python-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull TheBloke/CodeLlama-7B-Python-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.CodeLlama-7B-Python-GGUF-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Commit History
-
Initial GGUF model commit
e84cb69 -
Add Llama 2 license files
8bdb21b -
Add Llama 2 license files
45a84f5 -
Add Llama 2 license files
25acee7 -
Initial GGUF model commit
b41e892 -
Initial GGUF model commit
b11fa43 -
Initial GGUF model commit
45cee42 -
Initial GGUF model commit
18e958f -
Initial GGUF model commit
fb26282 -
Initial GGUF model commit
d4135b9 -
Initial GGUF model commit
b8c9313 -
Initial GGUF model commit
2075a50 -
Initial GGUF model commit
745b8fe -
Initial GGUF model commit
f277945 -
Initial GGUF model commit
6e472f0 -
Initial GGUF model commit
7ab2d9a -
Add Llama 2 license files
c274f4f -
Add Llama 2 license files
77b77bf -
Add Llama 2 license files
83b2ea0 -
Initial GGUF model commit
9f69f4d -
Initial GGUF model commit
a66cbd4 -
Initial GGUF model commit
beb9a6d -
Initial GGUF model commit
d3b8c9f -
Initial GGUF model commit
cd74d82 -
Initial GGUF model commit
0a119f4 -
Initial GGUF model commit
6d624a3 -
Initial GGUF model commit
01232aa -
Initial GGUF model commit
e40a635 -
Initial GGUF model commit
4a5b9c6 -
Initial GGUF model commit
85cca12 -
Initial GGUF model commit
c942ca3 -
Initial GGUF model commit
216e7ef -
Initial GGUF model commit
9a43719 -
Initial GGUF model commit
6b5b202 -
Initial GGUF model commit
61c22bd -
Initial GGUF model commit
78c88c1 -
Initial GGUF model commit
447b91a -
Initial GGUF model commit
b6affc8 -
Add Llama 2 license files
0f8ac2a -
Add Llama 2 license files
f41ba2c -
Add Llama 2 license files
be61380 -
Initial GGUF model commit
76affe3 -
Initial GGUF model commit
784bc25 -
Initial GGUF model commit
959bb67 -
Initial GGUF model commit
aa51c05 -
Initial GGUF model commit
2473707 -
Initial GGUF model commit
cceabec -
Initial GGUF model commit
a1552f3 -
Initial GGUF model commit
bbfa673 -
Initial GGUF model commit
ca49676