Anthropic

How Anthropic scales telemetry and billing data with Pub/Sub

Results on Google Cloud
  • Handles peak throughput of over 1M events per second

  • Ingests over 500 billion daily rows per Pub/Sub topic

  • Processes 3 GBps of sustained model training metrics

  • Achieves sub-second event latency from publish to query

  • Reduces consumer-side ingestion latency by 88%

Anthropic uses Pub/Sub to securely ingest, process, and analyze over one million telemetry and billing events per second.

A block diagram mapping Anthropic's multi-cloud ingestion setup
A block diagram mapping Anthropic's multi-cloud ingestion setup. It shows AWS-based and Google Cloud-based producers securely connecting over Private Service Connect to regional Pub/Sub topics. The diagram displays events fanning out to BigQuery, Dataflow, Cloud Storage, and external SIEM systems.

Anthropic builds frontier generative AI models, including the Claude family. Supporting these models requires processing massive, non-deterministic streams of billing, telemetry, and safety classifier events. Every interaction with Claude connects to the ingestion pipeline at least twice.

During large-scale training runs, traffic is highly variable—dropping to near zero during model checkpointing before bursting to millions of events per minute. Anthropic needed a serverless messaging queue that scaled dynamically without requiring manual partition management.

Securing cross-cloud telemetry at scale

Every single interaction with Claude—whether it's a chat message, an API call, a code completion—touches Pub/Sub at least twice. Once for billing metering, once for safety classifier telemetry. And most interactions touch it many more times than that.

Akshay Joshi

Member of Technical Staff, Anthropic

Training and inference runs span Google Cloud and AWS environments, Anthropic also required a secure cross-cloud transit path. Operating under strict security mandates, their most sensitive research workloads run in isolated namespaces that block all public internet egress.

Google Cloud Pub/Sub with Private Service Connect (PSC) met their requirements. PSC enabled Anthropic with access to a managed messaging service through a private IP in their VPC without exposing traffic to the Internet. They could support cross-cloud traffic without having to coordinate IP addresses and overlapping subnetworks. Anthropic captured all of these benefits without incurring added operational overhead.

Resolving payload and consumer latency limits

A flowchart illustrating the dual-path ingestion logic
A flowchart illustrating the dual-path ingestion logic. The compressed Protobuf payload is evaluated: if under 8 MB, it routes through the fast path directly to the Pub/Sub topic; if 8 MB or larger, it writes to Cloud Storage and triggers a Pub/Sub notification pointer to the ingestion service.

Anthropic uses Pub/Sub as the backbone of its ingestion pipeline. Because large machine learning payloads—such as high-dimensional embeddings and activations—frequently exceed multiple megabytes and can scale up to 100 MB, Anthropic designed a dual-path pipeline to optimize network throughput and cost-efficiency.

Producers serialize events into Protocol Buffers and apply zstd compression. If the compressed payload is under 8 MB, the client publishes the message directly to a Pub/Sub topic. If the payload is 8 MB or larger, the client writes the compressed bytes directly to a Cloud Storage bucket and publishes a lightweight JSON pointer notification containing the object URI through Pub/Sub. The downstream consumer uses this notification to fetch and decompress the payload from Cloud Storage. By reusing the pre-compressed bytes for the Cloud Storage upload, the pipeline avoids redundant compression cycles, keeping the messaging broker entirely unblocked.

One of Anthropic’s top priorities was reducing latency. When they profiled one of their consumer pipelines, they found that 88% of their latency was caused by Pub/Sub’s synchronous pull processing mode. Anthropic’s consumer fleet comprised 60 pods running ten parallel coroutines each—creating 600 concurrent connections on one subscription. When queues were empty, consumer threads were blocked for the duration of the long-poll timeout (ranging from 8 to 18 seconds).

To resolve this bottleneck, Anthropic migrated to StreamingPull. By establishing persistent, bidirectional gRPC connections, Pub/Sub pushed messages directly to workers as soon as they were published. This change eliminated synchronous polling overhead, dropping consumer latency to nearly zero.

Additionally, Anthropic’s Python services use the Trio concurrency library. Pub/Sub’s Python client library uses asyncio. Anthropic engineers built custom adapters to bridge integrate their Trio runtime using bounded queues and proper backpressure to prevent slow publishers from blowing out memory.

A two-row pipeline diagram
A two-row pipeline diagram. The top row shows the provisioning path (Protobuf definition → CI pipeline on merge → Pub/Sub Schema Registry, Topic, Subscription, and DLQ). The bottom row displays the runtime path (TypeScript/Python clients → EventLogger → Pub/Sub → SMT conversion → BigQuery tables).

Accelerating deployment with self-service ingestion

To prevent central platform teams from becoming operational bottlenecks, Anthropic built a declarative, self-service event platform on top of Pub/Sub.

The Protobuf file is the single source of truth. When developers update a schema and merge a pull request, the CI pipeline automatically registers the schema with the Pub/Sub Schema Registry, provisions the target BigQuery table, creates the Pub/Sub topic, and sets up a push subscription for zero-ETL data delivery. It also creates a Dead Letter Queue (DLQ) to handle schema mismatches.

We migrated to StreamingPull—persistent bidirectional gRPC with server-side push—and the pull overhead dropped to nearly zero. 88% of our end-to-end latency, gone with one architectural change.

Akshay Joshi

Member of Technical Staff, Anthropic

To ensure schema safety at scale, Anthropic uses Single Message Transforms (SMTs) to transform messages on the fly. This includes decoding base64-encoded nested JSON strings within the messaging control plane to align them with the BigQuery schema. Inline transformations prevent data loss and DLQ build-up without forcing client software updates. As of April 2026, this decoupled architecture effortlessly scales to support peak throughputs exceeding one million events per second, over 500 billion daily rows per topic, and 3 GB per second of sustained training metrics. The median end-to-end latency from publish to BigQuery remains under one second.

Design your streaming architecture with Pub/Sub

We scaled from early prototypes to billions of events a day without swapping the messaging layer. That's the power of a managed service that grows with you.

Akshay Joshi,

Member of Technical Staff, Anthropic

Whether managing multicloud streaming ingestion, building automated self-service event platforms, or optimizing payload routing, your messaging infrastructure must scale seamlessly from early prototypes to billions of daily events. By separating the routing and storage layers, Pub/Sub eliminates partition management and manual cluster scaling—allowing your platform teams to focus entirely on building application value.

Start designing your high-throughput event pipelines by reviewing the Pub/Sub architecture documentation, or contact a Google Cloud sales expert to plan your migration path.

Anthropic is an AI safety and research company. They build reliable, interpretable, and steerable AI systems.

Industry: Software and Internet

Location: San Francisco, CA, USA

Products: Pub/Sub, BigQuery, Dataflow, Cloud Storage, Bigtable

Google Cloud