← All LLMsGoogle
PaliGemma
Open weightstextimage
Vision-language Gemma variant.
- Developer
- Release date
- May 14, 2024
- Parameters
- Undisclosed
- Corpus size
- Undisclosed
- License
- Proprietary
- Context window
- 128K tokens
- Modalities
- text, image
Links
Learn this model
Tutorial tailored to PaliGemma—cost, capabilities, API setup, and production patterns based on this model's specs (not generic copy for every LLM).
Cost & access
PaliGemma weights are available under Proprietary. Direct API cost may be $0 if you self-host; budget for GPUs, storage, and engineering instead. Hosted endpoints (Together, Fireworks, Groq, etc.) charge per token—shop providers for paligemma latency and region. With a 128K tokens context window, long PDFs or chat histories increase input tokens quickly—trim history or summarize older turns in production.
Functional understanding
- Vision-language Gemma variant.
- Modalities: text, image · License: Proprietary · Released 2024-05-14.
- Best-fit workflows for this model:
- • Document OCR, chart/diagram understanding, and visual QA over screenshots or PDFs.
- • On-prem or VPC deployment when data cannot leave your network.
Technical foundation
- Google reports Undisclosed parameters; training data: Undisclosed.
- Context: 128K tokens. Open weights: yes.
- PaliGemma is positioned as a vision model in the Google lineup.
First API call
Use the Google Gen AI SDK with PaliGemma (paligemma).
from google import genai
client = genai.Client()
resp = client.models.generate_content(
model="paligemma",
contents="Explain PaliGemma in one paragraph.",
)
print(resp.text)Important technical topics
- Prompting PaliGemma: be explicit about output format. Weak: "Analyze this." Better: "Return JSON with fields id, total, date for Google billing data."
- Temperature: use 0–0.3 for extraction and compliance on PaliGemma; 0.7–1.0 for brainstorming.
- Tokens: PaliGemma bills by tokens (~¾ word each). Undisclosed parameters affect capability; your bill is driven by context length and call volume.
- Context window (128K tokens): everything in one request—system prompt, tools, RAG chunks, and history—must fit. Truncate or summarize when approaching the limit for PaliGemma.
- Vision tokens: images in PaliGemma consume extra tokens (often tiled patches)—compress resolution when cost matters.
Real enterprise patterns
- Pipeline: OCR/layout → PaliGemma for field extraction → rules engine for validation.
- Store original images; log model version per request for audit.
- Redact PII in images before sending to third-party APIs unless self-hosting.
- Fallback to smaller vision model for simple yes/no checks.
Production & security
- Secrets: never commit keys for PaliGemma; use vault + per-environment rotation.
- PII: mask before inference; log redacted prompts only.
- Observability: trace id per request; log model=paligemma, tokens in/out, latency.
- GPU monitoring: VRAM, batch queue depth, and model revision hash on each deploy.
- Guardrails: schema-validate JSON; block disallowed topics; cross-check numbers against source docs.
Mini projects with this model
- Invoice OCR: PaliGemma extracts line items → CSV.
- UI regression: compare screenshots, describe visual diffs.
- Safety checklist: verify PPE in warehouse photos.
- Catalog enrichment: generate alt text from product images.
Suggested stack
- Language: Python 3.11+
- Model: PaliGemma via Ollama, vLLM, or Hugging Face
- Hardware: NVIDIA GPU with enough VRAM for quantization level
- API wrapper: FastAPI or LiteLLM proxy
- UI: Streamlit or Next.js for internal tools
- APIs: FastAPI
- Vector DB (RAG): Pinecone / Chroma / pgvector
- OCR helper: Azure Document Intelligence or Tesseract pre-pass
Learning path
- Python basics
- HTTP/REST and environment variables
- Google authentication and PaliGemma model id (paligemma)
- First successful call to PaliGemma
- Prompt design and JSON / structured outputs
- Image encoding, resolution, and token costs
- RAG
- Tool use / function calling
- Evals and regression sets
- Production deploy + monitoring