Instructions to use prithivMLmods/Llama-Thinker-3B-Preview2-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use prithivMLmods/Llama-Thinker-3B-Preview2-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="prithivMLmods/Llama-Thinker-3B-Preview2-GGUF") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("prithivMLmods/Llama-Thinker-3B-Preview2-GGUF", dtype="auto") - llama-cpp-python
How to use prithivMLmods/Llama-Thinker-3B-Preview2-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="prithivMLmods/Llama-Thinker-3B-Preview2-GGUF", filename="llama-thinker-3b-preview2-f16.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use prithivMLmods/Llama-Thinker-3B-Preview2-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf prithivMLmods/Llama-Thinker-3B-Preview2-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf prithivMLmods/Llama-Thinker-3B-Preview2-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf prithivMLmods/Llama-Thinker-3B-Preview2-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf prithivMLmods/Llama-Thinker-3B-Preview2-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 prithivMLmods/Llama-Thinker-3B-Preview2-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf prithivMLmods/Llama-Thinker-3B-Preview2-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 prithivMLmods/Llama-Thinker-3B-Preview2-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf prithivMLmods/Llama-Thinker-3B-Preview2-GGUF:Q4_K_M
Use Docker
docker model run hf.co/prithivMLmods/Llama-Thinker-3B-Preview2-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use prithivMLmods/Llama-Thinker-3B-Preview2-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "prithivMLmods/Llama-Thinker-3B-Preview2-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": "prithivMLmods/Llama-Thinker-3B-Preview2-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/prithivMLmods/Llama-Thinker-3B-Preview2-GGUF:Q4_K_M
- SGLang
How to use prithivMLmods/Llama-Thinker-3B-Preview2-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 "prithivMLmods/Llama-Thinker-3B-Preview2-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": "prithivMLmods/Llama-Thinker-3B-Preview2-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 "prithivMLmods/Llama-Thinker-3B-Preview2-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": "prithivMLmods/Llama-Thinker-3B-Preview2-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use prithivMLmods/Llama-Thinker-3B-Preview2-GGUF with Ollama:
ollama run hf.co/prithivMLmods/Llama-Thinker-3B-Preview2-GGUF:Q4_K_M
- Unsloth Studio new
How to use prithivMLmods/Llama-Thinker-3B-Preview2-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for prithivMLmods/Llama-Thinker-3B-Preview2-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for prithivMLmods/Llama-Thinker-3B-Preview2-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for prithivMLmods/Llama-Thinker-3B-Preview2-GGUF to start chatting
- Pi new
How to use prithivMLmods/Llama-Thinker-3B-Preview2-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf prithivMLmods/Llama-Thinker-3B-Preview2-GGUF:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "prithivMLmods/Llama-Thinker-3B-Preview2-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use prithivMLmods/Llama-Thinker-3B-Preview2-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf prithivMLmods/Llama-Thinker-3B-Preview2-GGUF:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default prithivMLmods/Llama-Thinker-3B-Preview2-GGUF:Q4_K_M
Run Hermes
hermes
- Docker Model Runner
How to use prithivMLmods/Llama-Thinker-3B-Preview2-GGUF with Docker Model Runner:
docker model run hf.co/prithivMLmods/Llama-Thinker-3B-Preview2-GGUF:Q4_K_M
- Lemonade
How to use prithivMLmods/Llama-Thinker-3B-Preview2-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull prithivMLmods/Llama-Thinker-3B-Preview2-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Llama-Thinker-3B-Preview2-GGUF-Q4_K_M
List all available models
lemonade list
llm.create_chat_completion(
messages = [
{
"role": "user",
"content": "What is the capital of France?"
}
]
)Llama-Thinker-3B-Preview2-GGUF
Llama-Thinker-3B-Preview2 GGUF is a pretrained and instruction-tuned generative model designed for multilingual applications. These models are trained using synthetic datasets based on long chains of thought, enabling them to perform complex reasoning tasks effectively.
Model Architecture: [ Based on Llama 3.2 ] is an autoregressive language model that uses an optimized transformer architecture. The tuned versions undergo supervised fine-tuning (SFT) and reinforcement learning with human feedback (RLHF) to align with human preferences for helpfulness and safety.
Use with transformers
Starting with transformers >= 4.43.0 onward, you can run conversational inference using the Transformers pipeline abstraction or by leveraging the Auto classes with the generate() function.
Make sure to update your transformers installation via pip install --upgrade transformers.
import torch
from transformers import pipeline
model_id = "prithivMLmods/Llama-Thinker-3B-Preview2"
pipe = pipeline(
"text-generation",
model=model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
)
messages = [
{"role": "system", "content": "You are a pirate chatbot who always responds in pirate speak!"},
{"role": "user", "content": "Who are you?"},
]
outputs = pipe(
messages,
max_new_tokens=256,
)
print(outputs[0]["generated_text"][-1])
Note: You can also find detailed recipes on how to use the model locally, with torch.compile(), assisted generations, quantised and more at huggingface-llama-recipes
Use with llama
Please, follow the instructions in the repository
To download Original checkpoints, see the example command below leveraging huggingface-cli:
huggingface-cli download prithivMLmods/Llama-Thinker-3B-Preview2 --include "original/*" --local-dir Llama-Thinker-3B-Preview2
Here’s a version tailored for the Llama-Thinker-3B-Preview2-GGUF model:
How to Run Llama-Thinker-3B-Preview2 on Ollama Locally
This guide demonstrates how to run the Llama-Thinker-3B-Preview2-GGUF model locally using Ollama. The model is instruction-tuned for multilingual tasks and complex reasoning, making it highly versatile for a wide range of use cases. By the end, you'll be equipped to run this and other open-source models with ease.
Example 1: How to Run the Llama-Thinker-3B-Preview2 Model
The Llama-Thinker-3B-Preview2 model is a pretrained and instruction-tuned LLM, designed for complex reasoning tasks across multiple languages. In this guide, we'll interact with it locally using Ollama, with support for quantized models.
Step 1: Download the Model
First, download the Llama-Thinker-3B-Preview2-GGUF model using the following command:
ollama run llama-thinker-3b-preview2.gguf
Step 2: Model Initialization and Download
Once the command is executed, Ollama will initialize and download the necessary model files. You should see output similar to this:
pulling manifest
pulling a12cd3456efg... 100% ▕██████████████████████████████████████████████████████████████████████████████████████████▏ 3.2 GB
pulling 9f87ghijklmn... 100% ▕██████████████████████████████████████████████████████████████████████████████████████████▏ 6.5 KB
verifying sha256 digest
writing manifest
removing any unused layers
success
>>> Send a message (/? for help)
Step 3: Interact with the Model
Once the model is fully loaded, you can interact with it by sending prompts. For example, let's ask:
>>> How can you assist me today?
A sample response might look like this [may / maynot be identical]:
I am Llama-Thinker-3B-Preview2, an advanced AI language model designed to assist with complex reasoning, multilingual tasks, and general-purpose queries. Here are a few things I can help you with:
1. Answering complex questions in multiple languages.
2. Assisting with creative writing, content generation, and problem-solving.
3. Providing detailed summaries and explanations.
4. Translating text across different languages.
5. Generating ideas for personal or professional use.
6. Offering insights on technical topics.
Feel free to ask me anything you'd like assistance with!
Step 4: Exit the Program
To exit the program, simply type:
/exit
Example 2: Using Multi-Modal Models (Future Use)
In the future, Ollama may support multi-modal models where you can input both text and images for advanced interactions. This section will be updated as new capabilities become available.
Notes on Using Quantized Models
Quantized models like llama-thinker-3b-preview2.gguf are optimized for efficient performance on local systems with limited resources. Here are some key points to ensure smooth operation:
- VRAM/CPU Requirements: Ensure your system has adequate VRAM or CPU resources to handle model inference.
- Model Format: Use the
.ggufmodel format for compatibility with Ollama.
Conclusion
Running the Llama-Thinker-3B-Preview2 model locally using Ollama provides a powerful way to leverage open-source LLMs for complex reasoning and multilingual tasks. By following this guide, you can explore other models and expand your use cases as new models become available.
- Downloads last month
- 20
4-bit
5-bit
8-bit
16-bit
Model tree for prithivMLmods/Llama-Thinker-3B-Preview2-GGUF
Base model
meta-llama/Llama-3.2-3B-Instruct
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="prithivMLmods/Llama-Thinker-3B-Preview2-GGUF", filename="", )