Instructions to use shaw2037/Llama-3.2-3B-Instruct-Reasoning with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use shaw2037/Llama-3.2-3B-Instruct-Reasoning with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="shaw2037/Llama-3.2-3B-Instruct-Reasoning") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("shaw2037/Llama-3.2-3B-Instruct-Reasoning") model = AutoModelForCausalLM.from_pretrained("shaw2037/Llama-3.2-3B-Instruct-Reasoning", device_map="auto") 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use shaw2037/Llama-3.2-3B-Instruct-Reasoning with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "shaw2037/Llama-3.2-3B-Instruct-Reasoning" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "shaw2037/Llama-3.2-3B-Instruct-Reasoning", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/shaw2037/Llama-3.2-3B-Instruct-Reasoning
- SGLang
How to use shaw2037/Llama-3.2-3B-Instruct-Reasoning 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 "shaw2037/Llama-3.2-3B-Instruct-Reasoning" \ --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": "shaw2037/Llama-3.2-3B-Instruct-Reasoning", "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 "shaw2037/Llama-3.2-3B-Instruct-Reasoning" \ --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": "shaw2037/Llama-3.2-3B-Instruct-Reasoning", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use shaw2037/Llama-3.2-3B-Instruct-Reasoning with Docker Model Runner:
docker model run hf.co/shaw2037/Llama-3.2-3B-Instruct-Reasoning
LLaMA 3B Instruct Reasoning Model
This model is a fine-tuned version of LLaMA 3B Instruct, optimized for reasoning tasks such as step-by-step problem solving and logical question answering.
The model was fine-tuned using LoRA (PEFT) and later merged into the base model to create a fully standalone model.
Base Model
meta-llama/Llama-3-3b-instruct
Model Details
- Architecture: LLaMA 3B
- Fine-tuning method: LoRA (merged)
- Task: Causal Language Modeling
- Use case: Reasoning / instruction-following
Features
- Improved step-by-step reasoning
- Better structured answers
- Enhanced instruction following
- Suitable for logical tasks
Training Details
This model was fine-tuned on a reasoning dataset from Hugging Face using LoRA.
The LoRA weights were merged with the base model to produce a standalone model for easier deployment and usage.
How to Use
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "shaw2037/Llama-3.2-3B-Instruct-Reasoning"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
device_map="auto"
)
prompt = "Solve step by step: If 2x + 3 = 11, what is x?"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=200,
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Limitations
May produce incorrect reasoning steps.
Can hallucinate in complex scenarios.
Not guaranteed to be mathematically perfect.
Intended Use
Suitable for:
reasoning experiments
educational projects
LLM research
Not suitable for:
medical advice
legal advice
financial decisions
safety-critical applications
Install dependencies
pip install transformers accelerate torch
- Downloads last month
- 11
Model tree for shaw2037/Llama-3.2-3B-Instruct-Reasoning
Base model
meta-llama/Llama-3.2-3B-Instruct