Instructions to use harshit23442/Gemma-3-4B-Personal-Assistant with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use harshit23442/Gemma-3-4B-Personal-Assistant with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="harshit23442/Gemma-3-4B-Personal-Assistant") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("harshit23442/Gemma-3-4B-Personal-Assistant", device_map="auto") - PEFT
How to use harshit23442/Gemma-3-4B-Personal-Assistant with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use harshit23442/Gemma-3-4B-Personal-Assistant with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "harshit23442/Gemma-3-4B-Personal-Assistant" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "harshit23442/Gemma-3-4B-Personal-Assistant", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/harshit23442/Gemma-3-4B-Personal-Assistant
- SGLang
How to use harshit23442/Gemma-3-4B-Personal-Assistant 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 "harshit23442/Gemma-3-4B-Personal-Assistant" \ --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": "harshit23442/Gemma-3-4B-Personal-Assistant", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "harshit23442/Gemma-3-4B-Personal-Assistant" \ --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": "harshit23442/Gemma-3-4B-Personal-Assistant", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use harshit23442/Gemma-3-4B-Personal-Assistant with Docker Model Runner:
docker model run hf.co/harshit23442/Gemma-3-4B-Personal-Assistant
Gemma 3 4B Personal Assistant
A fine-tuned version of Google Gemma 3 4B IT, trained with QLoRA on conversational data derived from the OpenAssistant/oasst1 dataset.
This model is intended for conversational AI, instruction following, general question answering, coding assistance, summarization, and other general-purpose assistant tasks.
Base model:
google/gemma-3-4b-it
Model Overview
Gemma 3 4B Personal Assistant is a fine-tuned conversational model based on Google's Gemma 3 4B Instruction-Tuned model.
The model was fine-tuned using parameter-efficient QLoRA, allowing the training process to update a small fraction of the model's parameters while keeping the underlying Gemma model largely frozen.
After training, the LoRA adapter was merged into the base model to produce this standalone model.
Model Details
| Property | Value |
|---|---|
| Base model | google/gemma-3-4b-it |
| Model family | Gemma 3 |
| Parameter count | ~4.3B |
| Fine-tuning method | QLoRA / LoRA |
| Training objective | Supervised Fine-Tuning |
| Training dataset | OpenAssistant/oasst1 |
| Training examples | 300 |
| Validation examples | 188 |
| Epochs | 1 |
| Maximum sequence length | 2048 |
| Final model format | Safetensors |
| Framework | Hugging Face Transformers + PEFT + TRL |
Training
The model was fine-tuned using QLoRA, combining 4-bit quantization with Low-Rank Adaptation (LoRA).
Only a small portion of the model's parameters were trainable during fine-tuning, substantially reducing the computational and memory requirements compared with full-parameter training.
The training pipeline included:
- Conversational dataset reconstruction
- Conversation formatting using the Gemma 3 chat template
- 4-bit model quantization
- LoRA parameter-efficient fine-tuning
- Gradient accumulation
- Gradient checkpointing
- Supervised fine-tuning with TRL
- Final adapter merging into the base Gemma 3 model
The final adapter contained approximately 29.8M trainable parameters during fine-tuning, compared with approximately 4.33B total model parameters.
Dataset
Training data was derived from:
OpenAssistant/oasst1
The OASST1 dataset is a human-generated conversational dataset containing multi-turn assistant interactions and preference-related metadata.
Dataset:
https://huggingface.co/datasets/OpenAssistant/oasst1
OASST1 is distributed under the Apache 2.0 license. :contentReference[oaicite:1]{index=1}
This model uses a selected and reconstructed subset of the dataset for supervised conversational fine-tuning.
Intended Use
This model is intended for:
- General conversational assistance
- Question answering
- Instruction following
- Programming and coding assistance
- Summarization
- Text generation
- Educational assistance
- General-purpose experimentation
- Local AI assistants and research
The model is primarily intended for research, experimentation, education, and general-purpose assistant applications.
Usage with Transformers
The model can be loaded directly with Hugging Face Transformers.
import torch
from transformers import (
AutoProcessor,
Gemma3ForConditionalGeneration,
)
MODEL_ID = "harshit23442/Gemma-3-4B-Personal-Assistant"
processor = AutoProcessor.from_pretrained(MODEL_ID)
model = Gemma3ForConditionalGeneration.from_pretrained(
MODEL_ID,
torch_dtype=torch.bfloat16,
device_map="auto",
)