👑 Llama-3
Collection
My experiments with Llama-3 models • 55 items • Updated • 22
How to use MaziyarPanahi/Llama-3-13B-Instruct-v0.1-GGUF with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="MaziyarPanahi/Llama-3-13B-Instruct-v0.1-GGUF")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("MaziyarPanahi/Llama-3-13B-Instruct-v0.1-GGUF", device_map="auto")How to use MaziyarPanahi/Llama-3-13B-Instruct-v0.1-GGUF with llama.cpp:
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf MaziyarPanahi/Llama-3-13B-Instruct-v0.1-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf MaziyarPanahi/Llama-3-13B-Instruct-v0.1-GGUF:Q4_K_M
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf MaziyarPanahi/Llama-3-13B-Instruct-v0.1-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf MaziyarPanahi/Llama-3-13B-Instruct-v0.1-GGUF:Q4_K_M
# 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 MaziyarPanahi/Llama-3-13B-Instruct-v0.1-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf MaziyarPanahi/Llama-3-13B-Instruct-v0.1-GGUF:Q4_K_M
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 MaziyarPanahi/Llama-3-13B-Instruct-v0.1-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf MaziyarPanahi/Llama-3-13B-Instruct-v0.1-GGUF:Q4_K_M
docker model run hf.co/MaziyarPanahi/Llama-3-13B-Instruct-v0.1-GGUF:Q4_K_M
How to use MaziyarPanahi/Llama-3-13B-Instruct-v0.1-GGUF with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "MaziyarPanahi/Llama-3-13B-Instruct-v0.1-GGUF"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "MaziyarPanahi/Llama-3-13B-Instruct-v0.1-GGUF",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/MaziyarPanahi/Llama-3-13B-Instruct-v0.1-GGUF:Q4_K_M
How to use MaziyarPanahi/Llama-3-13B-Instruct-v0.1-GGUF with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "MaziyarPanahi/Llama-3-13B-Instruct-v0.1-GGUF" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "MaziyarPanahi/Llama-3-13B-Instruct-v0.1-GGUF",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "MaziyarPanahi/Llama-3-13B-Instruct-v0.1-GGUF" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "MaziyarPanahi/Llama-3-13B-Instruct-v0.1-GGUF",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use MaziyarPanahi/Llama-3-13B-Instruct-v0.1-GGUF with Ollama:
ollama run hf.co/MaziyarPanahi/Llama-3-13B-Instruct-v0.1-GGUF:Q4_K_M
How to use MaziyarPanahi/Llama-3-13B-Instruct-v0.1-GGUF with Docker Model Runner:
docker model run hf.co/MaziyarPanahi/Llama-3-13B-Instruct-v0.1-GGUF:Q4_K_M
How to use MaziyarPanahi/Llama-3-13B-Instruct-v0.1-GGUF with Lemonade:
# Download Lemonade from https://lemonade-server.ai/ lemonade pull MaziyarPanahi/Llama-3-13B-Instruct-v0.1-GGUF:Q4_K_M
lemonade run user.Llama-3-13B-Instruct-v0.1-GGUF-Q4_K_M
lemonade list
MaziyarPanahi/Llama-3-13B-Instruct-v0.1-GGUF contains GGUF format model files for MaziyarPanahi/Llama-3-13B-Instruct-v0.1.
You MUST follow the prompt template provided by Llama-3:
./llama.cpp/main -m Llama-3-13B-Instruct.Q2_K.gguf -r '<|eot_id|>' --in-prefix "\n<|start_header_id|>user<|end_header_id|>\n\n" --in-suffix "<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n\n" -p "<|begin_of_text|><|start_header_id|>system<|end_header_id|>\n\nYou are a helpful, smart, kind, and efficient AI assistant. You always fulfill the user's requests to the best of your ability.<|eot_id|>\n<|start_header_id|>user<|end_header_id|>\n\nHi! How are you?<|eot_id|>\n<|start_header_id|>assistant<|end_header_id|>\n\n" -n 1024
Base model
meta-llama/Meta-Llama-3-8B-Instruct