Instructions to use Meshwa/llama3.2-3b-Reflection-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use Meshwa/llama3.2-3b-Reflection-v1 with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Meshwa/llama3.2-3b-Reflection-v1", filename="llama3.2-3b-Reflection-v1.F16.gguf", )
llm.create_chat_completion( messages = "{\n \"question\": \"What is my name?\",\n \"context\": \"My name is Clara and I live in Berkeley.\"\n}" ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use Meshwa/llama3.2-3b-Reflection-v1 with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf Meshwa/llama3.2-3b-Reflection-v1:Q4_K_M # Run inference directly in the terminal: llama-cli -hf Meshwa/llama3.2-3b-Reflection-v1:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf Meshwa/llama3.2-3b-Reflection-v1:Q4_K_M # Run inference directly in the terminal: llama-cli -hf Meshwa/llama3.2-3b-Reflection-v1: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 Meshwa/llama3.2-3b-Reflection-v1:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf Meshwa/llama3.2-3b-Reflection-v1: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 Meshwa/llama3.2-3b-Reflection-v1:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf Meshwa/llama3.2-3b-Reflection-v1:Q4_K_M
Use Docker
docker model run hf.co/Meshwa/llama3.2-3b-Reflection-v1:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use Meshwa/llama3.2-3b-Reflection-v1 with Ollama:
ollama run hf.co/Meshwa/llama3.2-3b-Reflection-v1:Q4_K_M
- Unsloth Studio new
How to use Meshwa/llama3.2-3b-Reflection-v1 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 Meshwa/llama3.2-3b-Reflection-v1 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 Meshwa/llama3.2-3b-Reflection-v1 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Meshwa/llama3.2-3b-Reflection-v1 to start chatting
- Pi new
How to use Meshwa/llama3.2-3b-Reflection-v1 with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf Meshwa/llama3.2-3b-Reflection-v1: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": "Meshwa/llama3.2-3b-Reflection-v1:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use Meshwa/llama3.2-3b-Reflection-v1 with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf Meshwa/llama3.2-3b-Reflection-v1: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 Meshwa/llama3.2-3b-Reflection-v1:Q4_K_M
Run Hermes
hermes
- Docker Model Runner
How to use Meshwa/llama3.2-3b-Reflection-v1 with Docker Model Runner:
docker model run hf.co/Meshwa/llama3.2-3b-Reflection-v1:Q4_K_M
- Lemonade
How to use Meshwa/llama3.2-3b-Reflection-v1 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Meshwa/llama3.2-3b-Reflection-v1:Q4_K_M
Run and chat with the model
lemonade run user.llama3.2-3b-Reflection-v1-Q4_K_M
List all available models
lemonade list
Llama-3.2-3B-Instruct Fine-tuned on glaiveai/reflection-v1
- Developed by: Meshwa
- License: apache-2.0
- Finetuned from model : unsloth/Llama-3.2-3B-Instruct
This llama model was trained 2x faster with Unsloth and Huggingface's TRL library.
Overview
- Contains Llama-3.2-3B-Instruct,
- Fine-tuned on the glaiveai/reflection-v1 dataset using the Unsloth library.
- Model has been quantized into several formats (
q4,q5,q6,q8andf16) - Modelfile for use with Ollama is included, The default quantization is set to Q8_0, edit if you want to.
Model Description
Objective
Tried to finetune Llama-3.2-3B-Instruct leveraging the glaiveai/reflection-v1 dataset. I thought it would be fun to see how smaller models perform on this task.
Dataset: glaiveai/reflection-v1
The glaiveai/reflection-v1 dataset is tailored for reflective, introspective tasks, including open-ended conversation, abstract reasoning, and context-aware response generation. This dataset includes tasks such as:
- Thoughtful question answering
- Summarization of complex ideas
- Reflective problem solving
Fine-tuning Methodology: Unsloth Library
Unsloth was used for 2x faster finetuing of the base Llama-3.2 model.
Usage
Inference with gguf Quantized Models
To use the model in gguf format, load your preferred quantized version with a compatible inference framework such as llama.cpp or any gguf-supported libraries:
from llama_cpp import Llama
llama_model = Llama(model_path="path_to_model/Llama-3.2-3B-Instruct-q8_0.gguf")
result = llama_model("Your instruction prompt here")
print(result)
Using with Ollama
The included Modelfile supports direct loading in Ollama. To use the default model, simply run:
ollama create "model_name_here" -f "Modelfile_path"
Directly importing from HF 馃
ollama pull hf.co/Meshwa/llama3.2-3b-Reflection-v1:{quant_type}
make sure to replace {quant_type} with one of these:
Q4_K_MQ4_0Q4_1Q6_KQ8_0(default in my modelfile)Q5_K_MF16
For Better results use the below system prompt:
You are a world-class AI system capable of complex reasoning and reflection. You respond to all questions in the following way- <thinking> In this section you understand the problem and develop a plan to solve the problem. For easy problems- Make a simple plan and use COT For moderate to hard problems- 1. Devise a step-by-step plan to solve the problem. (don't actually start solving yet, just make a plan) 2. Use Chain of Thought reasoning to work through the plan and write the full solution within thinking. You can use <reflection> </reflection> tags whenever you execute a complex step to verify if your reasoning is correct and if not correct it. </thinking> <output> In this section, provide the complete answer for the user based on your thinking process. Do not refer to the thinking tag. Include all relevant information and keep the response somewhat verbose, the user will not see what is in the thinking tag. </output>
License
This model is released under the Apache 2.0.
Citation
If you use this model, please cite the following:
@article{Llama-3.2-3B-Instruct-Reflection-v1,
author = {Meshwa},
title = {Llama-3.2-3B-Instruct Fine-tuned on glaiveai/reflection-v1},
year = {2024},
published = {https://huggingface.co/Meshwa/llama3.2-3b-Reflection-v1}
}
- Downloads last month
- 223
4-bit
5-bit
6-bit
8-bit
16-bit
