# Vertex AI: taking Gemini to production
Vertex AI is where your Gemini prototype stops being a clever demo and becomes a system your company can actually trust with real users, real data, and real money. You have been calling Gemini through the Gemini APIAPIApplication Programming Interface: a standardised interface that lets applications communicate and exchange data without knowing each other's internal workings.Voir la définition complète → and Google AI Studio. That path is perfect for building and iterating fast. But the moment your project needs enterprise security, regional data control, audit trails, or predictable scale, you graduate to Vertex AI, Google Cloud's managed platform for shipping AI.
This lesson is about that graduation: when to move, what actually changes, and how to make the decision without overthinking it.
You already know the Gemini API on ai.google.dev. It gives you an API key, a generous free tier, and the fastest possible loop from idea to working call. This is sometimes called the
Vertex AI is the second door into the *same* Gemini models (Pro, Flash, and the rest), but wrapped in Google Cloud's machinery: IAM (Identity and Access Management), VPC networking, regional endpoints, logging, and quota management. Same model intelligence, very different operational surface.
Here is the key mental model: you are not switching models, you are switching the building the model lives in. AI Studio is a workshop. Vertex AI is a regulated factory floor.
The code difference is smaller than you might fear. Same SDK, different configuration:
from google import genai
# Developer API: just a key
dev = genai.Client(api_key="YOUR_API_KEY")
# Vertex AI: project + region, no key (uses Google Cloud auth)
prod = genai.Client(
vertexai=True,
project="my-gcp-project",
location="us-central1",
)
response = prod.models.generate_content(
model="gemini-2.5-flash",
contents="Summarize this support ticket in one sentence.",
)
print(response.text)Notice what disappeared: the APIAPIApplication Programming Interface: a standardised interface that lets applications communicate and exchange data without knowing each other's internal workings.Voir la définition complète → key. On Vertex, identity comes from Google Cloud credentials (a service account or your own gcloud login), not a string you paste into code. That single change is the heart of why enterprises move.
On the Developer APIAPIApplication Programming Interface: a standardised interface that lets applications communicate and exchange data without knowing each other's internal workings.Voir la définition complète →, an APIAPIApplication Programming Interface: a standardised interface that lets applications communicate and exchange data without knowing each other's internal workings.Voir la définition complète → key is a bearer tokentokenA token is the basic unit of text that language models process, often a word fragment, whole word, or punctuation mark rather than a single character.Voir la définition complète →: whoever holds it can use it. That is fine for a prototype, dangerous for production.
Vertex uses IAM. You grant a service account (a non-human identity for your app) a specific role like roles/aiplatform.user. Access is scoped, revocable, and logged per identity. You can answer "who called Gemini, when, and from where" because every request flows through Cloud Audit Logs.
# Grant a service account permission to call Vertex AI models
gcloud projects add-iam-policy-binding my-gcp-project \
--member="serviceAccount:app@my-gcp-project.iam.gserviceaccount.com" \
--role="roles/aiplatform.user"This is the reason regulated industries (healthcare, finance, public sector) often cannot use the Developer APIAPIApplication Programming Interface: a standardised interface that lets applications communicate and exchange data without knowing each other's internal workings.Voir la définition complète → at all. Vertex lets you pin processing to a region (the location in the code above), so data can stay in, say, the EU. It also gives you the enterprise data governanceenterprise data governanceData governance is the set of policies, roles, and processes that ensure data is accurate, secure, well-defined, and used responsibly across an organization.Voir la définition complète → terms most legal teams require: your prompts and outputs are not used to train Google's models, and you get contractual commitments around it. See cloud.google.com/vertex-ai for the current governance details.
Vertex AI endpoints can sit inside your VPC (Virtual Private Cloud) using Private Service Connect, so traffic to Gemini never traverses the public internet. Combined with VPC Service Controls, you build a perimeter that prevents data from leaking out even if a credential is compromised.
The free tier and pay-as-you-go limits on the Developer APIAPIApplication Programming Interface: a standardised interface that lets applications communicate and exchange data without knowing each other's internal workings.Voir la définition complète → are designed for building. Vertex gives you proper quota management and an option called Provisioned Throughput: you reserve dedicated capacity so a traffic spike does not get you rate-limited at the worst moment. You trade some flexibility for guaranteed, predictable performance. For a customer-facing app at scale, that predictability is the product.
You already understand RAG conceptually. Vertex operationalizes it. Grounding with Google Search is available on both doors, but Vertex adds Vertex AI Search and grounding against *your own* data stores: connect a corpus of internal documents and Gemini answers from them with citations, managed as a service instead of plumbing you maintain. This is the production-grade version of the RAG you prototyped earlier in this path.
Do not move just because "production" sounds serious. The Developer APIAPIApplication Programming Interface: a standardised interface that lets applications communicate and exchange data without knowing each other's internal workings.Voir la définition complète → runs real workloads fine. Move when one of these is true:
Stay on the Developer APIAPIApplication Programming Interface: a standardised interface that lets applications communicate and exchange data without knowing each other's internal workings.Voir la définition complète → when you are prototyping, building an internal tool with low stakes, shipping a side project, or moving fast and the governance overhead would just slow you down.
A mid-sized health insurer builds an internal assistant that answers employee questions about claims policy. The team prototypes it in AI Studio in an afternoon: paste the policy PDFs, wire up grounding, ship a Gem to a few colleagues. It works beautifully.
Then they decide to roll it out to 4,000 staff and connect it to live claims data. Now the questions change:
None of those needs were visible during the prototype. All of them are non-negotiable at rollout. That is the migration trigger: not the model, but the *obligations* around the model. The afternoon prototype and the production system run the *same* gemini-2.5-flash. Only the building changed.
Vérification des acquis
1. According to the lesson, what is the key difference in authentication when calling Gemini through Vertex AI instead of the Gemini Developer API?
2. Which analogy does the lesson use to describe the relationship between AI Studio and Vertex AI?
3. In Google Cloud, what does IAM (referenced in the lesson) primarily provide for a Vertex AI deployment?
4. Select ALL correct answers. According to the lesson, which capabilities are reasons a project would 'graduate' from the Gemini Developer API to Vertex AI?
Sélectionnez toutes les réponses correctes.
5. Select ALL correct answers. Based on the lesson, which statements about using the same SDK across both doors are true?
Sélectionnez toutes les réponses correctes.
Vertex is not a separate universe. It is the production tier under the tools you have already met:
A clean way to hold it: AI Studio and the Developer API are for building. Workspace and Gems are for using. Vertex AI is for operating at scale under rules.
Because the SDK is shared, porting a working prototype is usually small. The real work is the surrounding Cloud setup, not the AI logic.
A minimal production-shaped config looks like this:
# app config: same model, production posture
model: gemini-2.5-flash
vertex:
project: my-gcp-project
location: europe-west4 # EU data residency
use_provisioned_throughput: true
grounding:
datastore: claims-policy-corpus # Vertex AI Search
include_citations: true
auth:
service_account: app@my-gcp-project.iam.gserviceaccount.comYour prompt engineeringprompt engineeringPrompt engineering is the practice of designing and refining text inputs to guide large language models toward accurate, relevant, and reliable outputs.Voir la définition complète →, your tool definitions, your model choice: all carry over. What you add is identity, region, capacity, and governance. That asymmetry is the good news. Time spent making your prototype excellent is not wasted when you move; the intelligence transfers untouched.
Vertex AI adds operational weight: Google Cloud projects, IAM, billing setup, networking decisions. For a slightly technical professional this is a real step up in complexity, and it is genuinely overkill for many projects. The mistake is moving too early "to be safe" and drowning in cloud configuration before you have validated that anyone wants the product. Validate on the Developer APIAPIApplication Programming Interface: a standardised interface that lets applications communicate and exchange data without knowing each other's internal workings.Voir la définition complète →. Migrate when an obligation, not an ambition, forces your hand.
vertexai=True, plus project and location), not your prompts or logic.location to keep processing inside a jurisdiction, and pair it with VPC Service Controls and Provisioned Throughput for a true production posture.