14.2 Public, Dedicated & Private Endpoints
Key Takeaways
- Google recommends dedicated public endpoints and dedicated private endpoints using Private Service Connect as best practices for online inference.
- Shared public endpoints limit payloads to 1.5 MB, time out at 60 seconds, and have a 30,000 queries-per-minute quota, while dedicated and PSC endpoints allow 10 MB and timeouts up to 1 hour.
- Dedicated public endpoints don't support VPC Service Controls, so use a Private Service Connect endpoint inside a perimeter.
- Private endpoints based on VPC Network Peering support one model per endpoint, with no traffic splitting and no request-response logging.
- Tuned Gemini models can be deployed only to shared public endpoints.
The exam guide lists deploying models to public and private endpoints. Endpoint choice is mostly a networking and security decision, but it also limits payload size, timeouts, streaming, traffic splitting, and logging.
The Four Endpoint Types
| Feature | Dedicated public (recommended) | Shared public | Dedicated private via Private Service Connect (recommended) | Private (private services access / VPC peering) |
|---|---|---|---|---|
| Network access | Public internet, dedicated networking plane | Public internet, shared plane | Private, through a PSC forwarding rule in your VPC | Private, through VPC Network Peering |
| VPC Service Controls | Not supported | Supported | Supported | Supported |
| Network latency | Optimized | Unoptimized | Optimized | Optimized |
| Inference timeout | Up to 1 hour | 60 seconds | Up to 1 hour | 60 seconds |
| Payload limit | 10 MB | 1.5 MB | 10 MB | 10 MB |
| QPM quota | Unlimited | 30,000 | Unlimited | Unlimited |
| Protocols | HTTP or gRPC | HTTP | HTTP or gRPC | HTTP |
| Streaming (SSE) | Yes | No | Yes | No |
| Traffic split | Yes | Yes | Yes | No (one model per endpoint) |
| Request/response and access logging | Yes | Yes | Yes | No |
| Tuned Gemini deployment | No | Yes (only option) | No | No |
| AutoML models and explainability | No | Yes | No | No |
Dedicated and PSC endpoints support predict, rawPredict, streamRawPredict, and Chat Completion (Model Garden). gRPC requests must include the x-vertex-ai-endpoint-id header.
Private Service Connect Endpoints
Private Service Connect (PSC) puts a forwarding rule in your VPC that connects to a service attachment exposing Agent Platform inference. Benefits:
- No public IPs, no public internet path, and no peered IP range to plan.
- Serve multiple consumer projects and VPCs privately.
- Reach from on-premises over Cloud Interconnect or VPN.
- Works inside VPC Service Controls perimeters.
- Keeps dedicated-endpoint features such as streaming, gRPC, traffic splitting, and logging.
Google recommends PSC when inference must be private, secure, low latency, and not publicly accessible.
Private Services Access Endpoints (VPC Peering)
The older private option peers your VPC with the Agent Platform service network. Limitations to know:
- One model per endpoint, so no traffic splitting for canaries or A/B tests.
- No request-response or access logging.
- 60-second timeout and no streaming.
- Supports AutoML tabular and custom-trained models.
- Needs a reserved IP range and an active peering connection.
If a scenario needs private access and canary rollouts or logging for monitoring, choose PSC, not VPC peering.
Choosing an Endpoint
| Scenario | Endpoint |
|---|---|
| Public mobile app backend, large image payloads, gen AI streaming | Dedicated public |
| Quick prototype, small payloads, or deploying a tuned Gemini model | Shared public |
| Bank serving models to internal apps in several VPCs and on-premises, with a VPC Service Controls perimeter, canary rollouts, and logging | Private Service Connect |
| Existing peered architecture with a single model and no traffic splitting needs | Private (VPC peering) |
| Regulated workload that forbids public internet paths but still needs streaming | Private Service Connect |
Security Layers Beyond the Endpoint Type
- IAM: callers need permission to invoke the endpoint (for example, through the Agent Platform User role or a custom role scoped to prediction). Use service accounts for applications.
- VPC Service Controls: keep endpoints, models, and training data inside a perimeter to reduce exfiltration risk (Chapter 18).
- CMEK: encrypt model artifacts and endpoint resources with customer-managed keys where policy requires.
- Deployed model service account: give the serving container a least-privilege identity for any Google Cloud calls it makes.
- Audit logs: Cloud Audit Logs record administrative actions such as deploy and undeploy.
How Clients Reach a Private Service Connect Endpoint
- Create the endpoint with Private Service Connect enabled, and list the consumer projects allowed to connect.
- In each consumer VPC, create a forwarding rule (the PSC endpoint) with an internal IP address that targets the endpoint's service attachment.
- Optionally create a private DNS record so applications call a stable hostname instead of an IP address.
- Applications in that VPC, and on-premises systems connected through Cloud Interconnect or VPN, send requests to that internal address with normal IAM authentication.
- Deploy models and manage traffic splits on the endpoint as usual. The network path stays private.
Migrating Between Endpoint Types
An endpoint's networking type is set when the endpoint is created, so the usual pattern is to create the new endpoint (for example, PSC), deploy the same model version to it, move clients over gradually (DNS or configuration change), and then undeploy from the old endpoint. Keep the Model Registry version identical so predictions don't change during the move.
Common Mistakes
- Choosing a dedicated public endpoint for a workload that must sit inside a VPC Service Controls perimeter.
- Choosing a VPC-peering private endpoint and later discovering that canary rollouts and request logging aren't possible.
- Sending large base64 payloads to a shared public endpoint and hitting the 1.5 MB limit.
- Exposing internal-only models publicly and relying on IAM alone when policy forbids public paths.
Performance Notes
- Dedicated and private endpoints have optimized network latency compared with shared public endpoints.
- Large payloads such as images are better sent as Cloud Storage URIs when possible, even when 10 MB is allowed.
- Use gRPC on dedicated or PSC endpoints for lower serialization overhead at high QPS.
- Keep clients and endpoints in the same region.
Worked Scenario
A hospital network serves an imaging model to clinical apps. Requirements: no public exposure, a VPC Service Controls perimeter around PHI, 4 MB DICOM-derived payloads, gradual rollout of new versions, and request logging for audits.
- Shared public fails the payload limit and public exposure rules. Dedicated public fails VPC Service Controls. VPC-peering private endpoints fail traffic splitting and logging.
- Answer: a dedicated private endpoint using Private Service Connect.
A regulated company must serve a custom model privately inside a VPC Service Controls perimeter, run canary rollouts with traffic splitting, and log requests. Which endpoint type meets all requirements?
A mobile app sends 6 MB images to a model and occasionally needs 3-minute responses. The model is currently on a shared public endpoint, and requests fail. What is the most likely reason?
A team has a tuned Gemini model and wants to deploy it for online inference on Agent Platform. Which endpoint type can it use?