Instructions to use MaziyarPanahi/Meta-Llama-3-8B-Instruct-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MaziyarPanahi/Meta-Llama-3-8B-Instruct-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MaziyarPanahi/Meta-Llama-3-8B-Instruct-GGUF") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("MaziyarPanahi/Meta-Llama-3-8B-Instruct-GGUF", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use MaziyarPanahi/Meta-Llama-3-8B-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 MaziyarPanahi/Meta-Llama-3-8B-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf MaziyarPanahi/Meta-Llama-3-8B-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 MaziyarPanahi/Meta-Llama-3-8B-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf MaziyarPanahi/Meta-Llama-3-8B-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 MaziyarPanahi/Meta-Llama-3-8B-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf MaziyarPanahi/Meta-Llama-3-8B-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 MaziyarPanahi/Meta-Llama-3-8B-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf MaziyarPanahi/Meta-Llama-3-8B-Instruct-GGUF:Q4_K_M
Use Docker
docker model run hf.co/MaziyarPanahi/Meta-Llama-3-8B-Instruct-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use MaziyarPanahi/Meta-Llama-3-8B-Instruct-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MaziyarPanahi/Meta-Llama-3-8B-Instruct-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/Meta-Llama-3-8B-Instruct-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/MaziyarPanahi/Meta-Llama-3-8B-Instruct-GGUF:Q4_K_M
- SGLang
How to use MaziyarPanahi/Meta-Llama-3-8B-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 "MaziyarPanahi/Meta-Llama-3-8B-Instruct-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/Meta-Llama-3-8B-Instruct-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "MaziyarPanahi/Meta-Llama-3-8B-Instruct-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/Meta-Llama-3-8B-Instruct-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use MaziyarPanahi/Meta-Llama-3-8B-Instruct-GGUF with Ollama:
ollama run hf.co/MaziyarPanahi/Meta-Llama-3-8B-Instruct-GGUF:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use MaziyarPanahi/Meta-Llama-3-8B-Instruct-GGUF with Docker Model Runner:
docker model run hf.co/MaziyarPanahi/Meta-Llama-3-8B-Instruct-GGUF:Q4_K_M
- Lemonade
How to use MaziyarPanahi/Meta-Llama-3-8B-Instruct-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull MaziyarPanahi/Meta-Llama-3-8B-Instruct-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Meta-Llama-3-8B-Instruct-GGUF-Q4_K_M
List all available models
lemonade list
- Atomic Chat
What am I missing? - Langchain vs LMStudio
Hi, I've just started playing around with Quantized LLMs and their capabilities and to be honest it is amazing! But when I try to programmatically infer something the result I get is not to par with LMStudio results.
For example :
1)
I have given a huge text from a Resume and asked the model the following questions. Summarize the resume in less than 100 words. What are the job roles to which this profile will be suitable to? What are the technologies in which they worked on? What is your profile rating for the below resume? - It answered great, though it was slow which is expected
I was expecting a similar response when I tried to infer the model with langchain using below code.
from langchain_community.llms import LlamaCpp
from langchain_core.callbacks import CallbackManager, StreamingStdOutCallbackHandler
Callbacks support token-wise streaming
callback_manager = CallbackManager([StreamingStdOutCallbackHandler()])
Make sure the model path is correct for your system!
llm = LlamaCpp(
model_path=MODEL_PATH,
callback_manager=callback_manager,
verbose=True, # Verbose is required to pass to the callback manager
n_ctx=4096,
n_threads=4,
n_batch = 512,
temperature=0.8,
top_p=0.95,
top_k=40,
repeat_penalty=1.1,
)
llm.invoke("""Resume Text Here""")
But it failed midway when it was trying to infer the content alone. It never reached to prediction of the answer.
- When I tried with a resume text which is half of what I used initially, I was getting a response from the model now (through langchain) but the context was not up-to the mark.
I played around with prompts/prompt templates/Jinja2 Templates but did not have much luck.
I am looking for approach/guidance which I am missing here.
Long Story Short : What is it that I need to do extra to get a decent quality output that I get in LMStudio? Assuming I already have the default setting of the model whichever is available in LMStudio. A sample of how to infer the model, like the format of text/messages/content/instruction for better output.
Any little help would be appreciated. Thanks in Advance
