Instructions to use SURESHBEEKHANI/llama_3_2_3B-dpo-rlhf-fine-tuning with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use SURESHBEEKHANI/llama_3_2_3B-dpo-rlhf-fine-tuning 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 SURESHBEEKHANI/llama_3_2_3B-dpo-rlhf-fine-tuning:Q4_K_M # Run inference directly in the terminal: llama cli -hf SURESHBEEKHANI/llama_3_2_3B-dpo-rlhf-fine-tuning:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf SURESHBEEKHANI/llama_3_2_3B-dpo-rlhf-fine-tuning:Q4_K_M # Run inference directly in the terminal: llama cli -hf SURESHBEEKHANI/llama_3_2_3B-dpo-rlhf-fine-tuning: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 SURESHBEEKHANI/llama_3_2_3B-dpo-rlhf-fine-tuning:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf SURESHBEEKHANI/llama_3_2_3B-dpo-rlhf-fine-tuning: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 SURESHBEEKHANI/llama_3_2_3B-dpo-rlhf-fine-tuning:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf SURESHBEEKHANI/llama_3_2_3B-dpo-rlhf-fine-tuning:Q4_K_M
Use Docker
docker model run hf.co/SURESHBEEKHANI/llama_3_2_3B-dpo-rlhf-fine-tuning:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use SURESHBEEKHANI/llama_3_2_3B-dpo-rlhf-fine-tuning with Ollama:
ollama run hf.co/SURESHBEEKHANI/llama_3_2_3B-dpo-rlhf-fine-tuning:Q4_K_M
- Unsloth Studio
How to use SURESHBEEKHANI/llama_3_2_3B-dpo-rlhf-fine-tuning 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 SURESHBEEKHANI/llama_3_2_3B-dpo-rlhf-fine-tuning 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 SURESHBEEKHANI/llama_3_2_3B-dpo-rlhf-fine-tuning to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for SURESHBEEKHANI/llama_3_2_3B-dpo-rlhf-fine-tuning to start chatting
- Pi
How to use SURESHBEEKHANI/llama_3_2_3B-dpo-rlhf-fine-tuning with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf SURESHBEEKHANI/llama_3_2_3B-dpo-rlhf-fine-tuning: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": "SURESHBEEKHANI/llama_3_2_3B-dpo-rlhf-fine-tuning:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use SURESHBEEKHANI/llama_3_2_3B-dpo-rlhf-fine-tuning with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf SURESHBEEKHANI/llama_3_2_3B-dpo-rlhf-fine-tuning: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 SURESHBEEKHANI/llama_3_2_3B-dpo-rlhf-fine-tuning:Q4_K_M
Run Hermes
hermes
- Atomic Chat new
- OpenClaw new
How to use SURESHBEEKHANI/llama_3_2_3B-dpo-rlhf-fine-tuning with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf SURESHBEEKHANI/llama_3_2_3B-dpo-rlhf-fine-tuning:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "SURESHBEEKHANI/llama_3_2_3B-dpo-rlhf-fine-tuning:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- Docker Model Runner
How to use SURESHBEEKHANI/llama_3_2_3B-dpo-rlhf-fine-tuning with Docker Model Runner:
docker model run hf.co/SURESHBEEKHANI/llama_3_2_3B-dpo-rlhf-fine-tuning:Q4_K_M
- Lemonade
How to use SURESHBEEKHANI/llama_3_2_3B-dpo-rlhf-fine-tuning with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull SURESHBEEKHANI/llama_3_2_3B-dpo-rlhf-fine-tuning:Q4_K_M
Run and chat with the model
lemonade run user.llama_3_2_3B-dpo-rlhf-fine-tuning-Q4_K_M
List all available models
lemonade list
Install from WinGet (Windows)
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama serve -hf SURESHBEEKHANI/llama_3_2_3B-dpo-rlhf-fine-tuning:Q4_K_M# Run inference directly in the terminal:
llama cli -hf SURESHBEEKHANI/llama_3_2_3B-dpo-rlhf-fine-tuning:Q4_K_MUse 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 SURESHBEEKHANI/llama_3_2_3B-dpo-rlhf-fine-tuning:Q4_K_M# Run inference directly in the terminal:
./llama-cli -hf SURESHBEEKHANI/llama_3_2_3B-dpo-rlhf-fine-tuning:Q4_K_MBuild 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 SURESHBEEKHANI/llama_3_2_3B-dpo-rlhf-fine-tuning:Q4_K_M# Run inference directly in the terminal:
./build/bin/llama-cli -hf SURESHBEEKHANI/llama_3_2_3B-dpo-rlhf-fine-tuning:Q4_K_MUse Docker
docker model run hf.co/SURESHBEEKHANI/llama_3_2_3B-dpo-rlhf-fine-tuning:Q4_K_MFine-tuned Language Model for Preference Optimization (DPO)
Model Overview
This model is a fine-tuned version of Llama 3.2-3B-Instruct with Direct Preference Optimization (DPO), specialized for reward modeling tasks. It has been optimized using memory-efficient techniques including 4-bit quantization, gradient checkpointing, and parameter-efficient fine-tuning (PEFT). The model is tailored for tasks requiring language comprehension, instruction-based response generation, and preference-based ranking of responses.
Model Details
- Base Model:
unsloth/Llama-3.2-3B-Instruct - Fine-Tuning Objective: Preference Optimization (DPO) using pairs of accepted and rejected responses.
- Training Framework: Built on Unsloth with integration to Hugging Face Datasets and Transformers.
- Quantization: Utilizes 4-bit quantization for reduced memory usage, suitable for low VRAM devices.
- Optimizations: Includes gradient checkpointing for enhanced memory efficiency and faster inference. The model has undergone fine-tuning using PEFT methods such as LoRA (Low-Rank Adaptation).
- Training Data: Trained on the Intel/orca_dpo_pairs dataset containing instruction-input-response pairs for preference-based learning.
Model Capabilities
- Text Generation: Capable of generating detailed and coherent text responses based on instructions or prompts.
- Preference-Based Optimization: Fine-tuned to rank responses based on user feedback (chosen vs. rejected).
- Long Contexts: Supports processing up to 2048 tokens of input efficiently, facilitated by internal RoPE scaling.
- Faster Inference: Optimized for real-time text generation with streaming capabilities and low-latency responses.
Intended Use
This model can be applied to various natural language processing (NLP) tasks, including:
- Question Answering: Responding to user queries with detailed and contextually accurate information.
- Instruction Following: Generating responses based on user-defined tasks.
- Preference Modeling: Ranking different responses based on preferences provided in training data.
- Text Completion: Completing partially given texts based on provided instructions.
Limitations
- Context Length: While capable of processing up to 2048 tokens, extremely long texts may require additional optimization or truncation.
- Precision: The model's 4-bit quantization may result in minor loss of precision in certain edge cases requiring high accuracy.
- Dataset Bias: Reflects biases present in the training dataset used for preference pairs labeling.
Technical Details
- Model Architecture: Based on Llama 3.2 with 3 billion parameters.
- Training Method: Fine-tuned using Direct Preference Optimization (DPO).
- Optimizer: Utilizes AdamW optimizer with 8-bit precision for efficiency.
- Batch Size: Effective batch size of 8 (2 per device with 4-step gradient accumulation).
- Training Configuration:
- Learning rate: 5e-6
- Warm-up ratio: 0.1
- Epochs: 1
- Max sequence length: 2048 tokens
- Mixed Precision Training: Supports FP16 and BFloat16 depending on hardware.
Usage Instructions
Install Dependencies
Ensure torch, transformers, unsloth, and other required libraries are installed for inference and fine-tuning.
Load Pretrained Model
You can load the model using FastLanguageModel.from_pretrained() by specifying the model name and optimization settings.
Fine-Tuning
Apply PEFT and quantization strategies (e.g., LoRA, gradient checkpointing) using the dataset of preference pairs for fine-tuning.
Inference
Use the FastLanguageModel.for_inference() method to enable optimized text generation, which supports streaming inference for real-time output.
Performance Metrics
- Training Loss: 1.19
- Training Runtime: 1974.06 seconds (approximately 32 minutes)
- Steps Per Second: 0.063
- Samples Per Second: 0.507
Model Version
- Version: Unsloth 2025.1.7 (Patched version)
- Training Date: January 2025
Acknowledgements
This model was trained using the Unsloth framework with contributions from Intel and Hugging Face for data and tools.
Notebook
Access the implementation notebook for this model here. This notebook provides detailed steps for fine-tuning and deploying the model.
- Downloads last month
- 17
4-bit
Model tree for SURESHBEEKHANI/llama_3_2_3B-dpo-rlhf-fine-tuning
Base model
meta-llama/Llama-3.2-3B-Instruct
Install (macOS, Linux)
# Start a local OpenAI-compatible server with a web UI: llama serve -hf SURESHBEEKHANI/llama_3_2_3B-dpo-rlhf-fine-tuning:Q4_K_M# Run inference directly in the terminal: llama cli -hf SURESHBEEKHANI/llama_3_2_3B-dpo-rlhf-fine-tuning:Q4_K_M