Instructions to use kth8/gemma-3-270m-it-homeowner-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kth8/gemma-3-270m-it-homeowner-classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="kth8/gemma-3-270m-it-homeowner-classifier") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("kth8/gemma-3-270m-it-homeowner-classifier") model = AutoModelForCausalLM.from_pretrained("kth8/gemma-3-270m-it-homeowner-classifier") 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 kth8/gemma-3-270m-it-homeowner-classifier with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kth8/gemma-3-270m-it-homeowner-classifier" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kth8/gemma-3-270m-it-homeowner-classifier", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/kth8/gemma-3-270m-it-homeowner-classifier
- SGLang
How to use kth8/gemma-3-270m-it-homeowner-classifier 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 "kth8/gemma-3-270m-it-homeowner-classifier" \ --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": "kth8/gemma-3-270m-it-homeowner-classifier", "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 "kth8/gemma-3-270m-it-homeowner-classifier" \ --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": "kth8/gemma-3-270m-it-homeowner-classifier", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use kth8/gemma-3-270m-it-homeowner-classifier 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 kth8/gemma-3-270m-it-homeowner-classifier 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 kth8/gemma-3-270m-it-homeowner-classifier to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for kth8/gemma-3-270m-it-homeowner-classifier to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="kth8/gemma-3-270m-it-homeowner-classifier", max_seq_length=2048, ) - Docker Model Runner
How to use kth8/gemma-3-270m-it-homeowner-classifier with Docker Model Runner:
docker model run hf.co/kth8/gemma-3-270m-it-homeowner-classifier
A supervised fine-tune of unsloth/gemma-3-270m-it on the kth8/homeowner-classification dataset.
Inspired by https://www.teachmecoolstuff.com/viewarticle/fine-tuning-a-local-llm-to-categorize-questions
Use temperature=0.0 for optimal results.
Usage example
System prompt
Classify the homeowner question into a category from the list below.
The answer must be exactly one category name from the list in JSON format.
Choose the best category based on the meaning of the question.
Valid categories:
- appliances
- brick work
- car
- cooking
- doorbell
- electric
- fence
- fountain
- garden lights
- gutters
- hvac
- irrigation
- mosquito
- painting
- pool
- tree service
- water heater
- window service
User prompt
What is the CYA level supposed to be in the pool water?
Assistant response
{"category": "pool"}
Model Details
- Base Model:
unsloth/gemma-3-270m-it - Parameter Count: 268,098,176
- Precision: torch.bfloat16
Training Settings
PEFT
- Rank: 32
- LoRA alpha: 64
- Modules: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
- Gradient checkpointing: unsloth
SFT
- Epoch: 1
- Batch size: 8
- Gradient Accumulation steps: 2
- Learning rate: 0.0002
- Optimizer: adamw_torch_fused
- Learning rate scheduler: cosine
- Warmup steps: 10
- Weight decay: 0.01
Training stats
- Date: 2026-06-17T01:06:10.026211
- GPU: NVIDIA L4
- Peak VRAM usage: 2.205 GB
- Global step: 126
- Training runtime (seconds): 334.7612
- Best validation loss: 0.013801434077322483
| Step | Training Loss | Validation Loss |
|---|---|---|
| 0 | No log | 2.182445 |
| 12 | 1.131100 | 0.195152 |
| 24 | 0.122900 | 0.082139 |
| 36 | 0.076800 | 0.034620 |
| 48 | 0.075600 | 0.027673 |
| 60 | 0.039300 | 0.031881 |
| 72 | 0.038300 | 0.020789 |
| 84 | 0.031200 | 0.015834 |
| 96 | 0.018400 | 0.013921 |
| 108 | 0.030300 | 0.014498 |
| 120 | 0.023700 | 0.013801 |
Framework versions
- Unsloth: 2026.6.7
- TRL: 0.22.2
- Transformers: 4.56.2
- Pytorch: 2.11.0+cu128
- Datasets: 5.0.0
- Tokenizers: 0.22.2
License
This model is released under the Gemma license. See the Gemma Terms of Use and Prohibited Use Policy regarding the use of Gemma-generated content.
- Downloads last month
- 59