Instructions to use shehryars715/finetuned-llama-3.2-3b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use shehryars715/finetuned-llama-3.2-3b with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/Llama-3.2-3B-Instruct-bnb-4bit") model = PeftModel.from_pretrained(base_model, "shehryars715/finetuned-llama-3.2-3b") - Transformers
How to use shehryars715/finetuned-llama-3.2-3b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="shehryars715/finetuned-llama-3.2-3b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("shehryars715/finetuned-llama-3.2-3b", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use shehryars715/finetuned-llama-3.2-3b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "shehryars715/finetuned-llama-3.2-3b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "shehryars715/finetuned-llama-3.2-3b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/shehryars715/finetuned-llama-3.2-3b
- SGLang
How to use shehryars715/finetuned-llama-3.2-3b 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 "shehryars715/finetuned-llama-3.2-3b" \ --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": "shehryars715/finetuned-llama-3.2-3b", "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 "shehryars715/finetuned-llama-3.2-3b" \ --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": "shehryars715/finetuned-llama-3.2-3b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use shehryars715/finetuned-llama-3.2-3b 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 shehryars715/finetuned-llama-3.2-3b 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 shehryars715/finetuned-llama-3.2-3b to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for shehryars715/finetuned-llama-3.2-3b to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="shehryars715/finetuned-llama-3.2-3b", max_seq_length=2048, ) - Docker Model Runner
How to use shehryars715/finetuned-llama-3.2-3b with Docker Model Runner:
docker model run hf.co/shehryars715/finetuned-llama-3.2-3b
πΎ Agricultural Advisory LLM β Llama-3.2-3B LoRA
A LoRA fine-tuned version of Llama-3.2-3B-Instruct for agricultural question answering and crop advisory generation. This is the 3B parameter variant β more capable than the 1B version for complex agronomic reasoning while remaining lightweight enough for edge deployment.
Fine-tuned using Unsloth for fast, memory-efficient training on a single GPU.
Also available: 1B variant (lighter, faster inference)
Model Details
| Field | Details |
|---|---|
| Base model | unsloth/Llama-3.2-3B-Instruct-bnb-4bit |
| Fine-tuning method | LoRA (Low-Rank Adaptation) via PEFT |
| Trainer | SFTTrainer (TRL) + Unsloth |
| Precision | 4-bit quantized (bitsandbytes) |
| Language | English |
| Domain | Agriculture / Crop Advisory |
| Developed by | shehryars715 |
Intended Use
β Direct Use
- Answering crop-specific agricultural questions (pest control, irrigation, fertilization, disease management)
- Generating advisories from remote sensing inputs (NDVI, EVI, crop growth stage)
- Decision support for farmers, agronomists, and precision agriculture systems
β Downstream Use
- Backend for agri-advisory chatbots and mobile apps
- Integration into precision agriculture dashboards
- RAG pipelines augmented with real-time field sensor data
β Out-of-Scope Use
- Medical, legal, or financial advice
- Non-agricultural domains
- Autonomous high-stakes decisions without human expert review
Training Details
Training Data
Two datasets were mixed during fine-tuning:
- General Agricultural Advisories β structured Q&A with fields:
crop,topic,question,answer - Farm Sensor Data Advisories β precision agriculture records with fields:
crop_type,stage,NDVI,EVI, and generatedAdvisory
Training Hyperparameters
| Parameter | Value |
|---|---|
| Training regime | fp16 mixed precision |
| LoRA rank (r) | 16 |
| LoRA alpha | 16 |
| LoRA dropout | 0 |
| Target modules | q, k, v, o, gate, up, down proj |
| Batch size | 2 (per device) |
| Gradient accumulation | 4 steps (effective batch = 8) |
| Epochs | 3 |
| Learning rate | 2e-4 |
| Optimizer | AdamW 8-bit |
| LR scheduler | Linear |
| Max seq length | 2048 |
| Hardware | Kaggle (NVIDIA T4 / P100, single GPU) |
How to Get Started
With Unsloth (recommended β fastest)
- Downloads last month
- 5
Model tree for shehryars715/finetuned-llama-3.2-3b
Base model
meta-llama/Llama-3.2-3B-Instruct