Kaggle Models Intermediate
The Kaggle Models hub provides a curated collection of pre-trained models that you can use directly in your notebooks. Browse models from Google, Meta, Hugging Face, and the community.
Kaggle Models Hub
Visit kaggle.com/models to browse available models. The hub organizes models by:
- Framework: TensorFlow, PyTorch, JAX, Keras, ONNX
- Task: Image classification, text generation, object detection, NLP, etc.
- Publisher: Google, Meta, Hugging Face, community contributors
- Size: From small models suitable for free GPUs to large foundation models
Pre-trained Models Available
Kaggle hosts models across many categories:
- NLP: BERT, GPT-2, T5, Gemma, LLaMA, Mistral, Phi
- Computer Vision: ResNet, EfficientNet, ViT, YOLO, SAM
- Generative: Stable Diffusion, DALL-E, Whisper
- Multimodal: CLIP, LLaVA, Gemma with vision
- Audio: Whisper, Wav2Vec, HuBERT
Using Models in Notebooks
Add a pre-trained model to your Kaggle notebook:
- Click + Add Input in your notebook
- Switch to the Models tab
- Search for the model you need
- Select the framework and variation
- The model files are available at
/kaggle/input/
# Example: Load a pre-trained model from Kaggle Models
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
# Model attached via Kaggle UI is at /kaggle/input/
model_path = '/kaggle/input/gemma/pytorch/2b-it/1'
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForCausalLM.from_pretrained(
model_path,
torch_dtype=torch.float16,
device_map='auto'
)
# Generate text
inputs = tokenizer("What is machine learning?", return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=100)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Hugging Face Integration
Kaggle Models integrates with Hugging Face, making thousands of models accessible:
# Use Hugging Face models directly in Kaggle
from transformers import pipeline
# Sentiment analysis
classifier = pipeline("sentiment-analysis")
result = classifier("Kaggle is an amazing platform for learning data science!")
print(result)
# Text generation
generator = pipeline("text-generation", model="gpt2")
text = generator("The future of AI is", max_length=50)
print(text)
# Image classification
from transformers import AutoImageProcessor, AutoModelForImageClassification
from PIL import Image
processor = AutoImageProcessor.from_pretrained("google/vit-base-patch16-224")
model = AutoModelForImageClassification.from_pretrained("google/vit-base-patch16-224")
Model Versioning
- Models on Kaggle support versioning (v1, v2, v3...)
- Each version includes model weights, configuration, and metadata
- You can pin a specific version in your notebook for reproducibility
- Model publishers can update with new versions while keeping old ones available
Publishing Your Own Models
Train Your Model
Train and validate your model in a Kaggle notebook or locally.
Save Model Files
Save weights, config, tokenizer, and any other required files.
Create Model on Kaggle
Go to Models → New Model. Upload your files and add documentation.
Add Metadata
Specify the framework, task type, license, and a model card with usage instructions.
Publish
Set visibility to public and share with the community.
Popular Models
| Model | Publisher | Task | Frameworks |
|---|---|---|---|
| Gemma | Text Generation | PyTorch, Keras, JAX | |
| LLaMA 3 | Meta | Text Generation | PyTorch |
| Mistral | Mistral AI | Text Generation | PyTorch |
| BERT | NLP / Classification | TensorFlow, PyTorch | |
| EfficientNet | Image Classification | TensorFlow, PyTorch | |
| Whisper | OpenAI | Speech-to-Text | PyTorch |
| Stable Diffusion | Stability AI | Image Generation | PyTorch |
| ViT | Image Classification | PyTorch, JAX |
Ready to Go Deeper?
Live instructor-led courses from our partners. Affiliate disclosure.
AI & ML Courses - 30% Off
Live instructor-led AI, machine learning, data science, and cloud courses for working professionals. Use code Limited30 at checkout.
EdurekaDataCamp - AI & Data Science
Hands-on Python, machine learning, and AI courses with interactive exercises and real projects.
DataCampedX - Top AI Courses
University-level AI courses from MIT, Harvard, Stanford. Earn certificates that employers recognize.
edX