Instructions to use mjpsm/Llama-3.2-1B-Instruction-Chatbot with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mjpsm/Llama-3.2-1B-Instruction-Chatbot with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mjpsm/Llama-3.2-1B-Instruction-Chatbot") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("mjpsm/Llama-3.2-1B-Instruction-Chatbot") model = AutoModelForCausalLM.from_pretrained("mjpsm/Llama-3.2-1B-Instruction-Chatbot") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use mjpsm/Llama-3.2-1B-Instruction-Chatbot with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mjpsm/Llama-3.2-1B-Instruction-Chatbot" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mjpsm/Llama-3.2-1B-Instruction-Chatbot", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/mjpsm/Llama-3.2-1B-Instruction-Chatbot
- SGLang
How to use mjpsm/Llama-3.2-1B-Instruction-Chatbot 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 "mjpsm/Llama-3.2-1B-Instruction-Chatbot" \ --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": "mjpsm/Llama-3.2-1B-Instruction-Chatbot", "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 "mjpsm/Llama-3.2-1B-Instruction-Chatbot" \ --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": "mjpsm/Llama-3.2-1B-Instruction-Chatbot", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use mjpsm/Llama-3.2-1B-Instruction-Chatbot with Docker Model Runner:
docker model run hf.co/mjpsm/Llama-3.2-1B-Instruction-Chatbot
Llama 3.2 1B Instruction Chatbot
Overview
This repository contains a fully merged version of a LoRA fine-tuned Llama 3.2 1B Instruct model.
Unlike the adapter repository, this model can be loaded directly with the Hugging Face Transformers library without requiring PEFT.
The model was created to demonstrate the complete lifecycle of modern large language model fine-tuning, including:
- Dataset preparation
- Chat formatting
- QLoRA training
- LoRA merging
- Hugging Face deployment
Base Model
- meta-llama/Llama-3.2-1B-Instruct
Training Dataset
Approximately 40,000 instruction-response examples formatted into conversational chat format.
Training Configuration
Training Method
- QLoRA
Merged Into
- Full standalone Transformers model
Frameworks
- Transformers
- TRL
- PEFT
- Accelerate
- BitsAndBytes
Hyperparameters
| Parameter | Value |
|---|---|
| Epochs | 1 |
| Batch Size | 2 |
| Gradient Accumulation | 4 |
| Learning Rate | 2e-4 |
| Optimizer | paged_adamw_8bit |
| Scheduler | Cosine |
| Precision | FP16 |
Training Results
| Metric | Value |
|---|---|
| Training Loss | 0.15088 |
| Runtime | 6789.63 seconds |
| Global Steps | 5000 |
| Samples / Second | 5.89 |
| Steps / Second | 0.736 |
Intended Uses
- Conversational AI
- Instruction following
- Educational projects
- Fine-tuning demonstrations
- Research
Limitations
This model has not been benchmarked against established instruction-following datasets such as MT-Bench, AlpacaEval, or MMLU.
It has not undergone additional safety alignment beyond the original base model.
Responses may contain hallucinations or factual inaccuracies.
Loading the Model
from transformers import AutoTokenizer
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained(
"mjpsm/Llama-3.2-1B-Instruction-Chatbot"
)
tokenizer = AutoTokenizer.from_pretrained(
"mjpsm/Llama-3.2-1B-Instruction-Chatbot"
)
Citation
If you use this model in your work, please cite this repository.
- Downloads last month
- 61