DEV Community

Cover image for FinOps for AI: Understanding GPU, Token, and Inference Costs
Sushyam Nagallapati
Sushyam Nagallapati

Posted on

FinOps for AI: Understanding GPU, Token, and Inference Costs

Thanks for taking the time to read. If you’ve worked with AI infrastructure or cloud cost optimization, I’d love to hear what has been hardest to control in the comments.

In Part 3 of AI Infrastructure for Cloud Engineers, we looked at observability across Kubernetes, GPUs, inference, logs, traces, and user-facing performance.

Read Part 3: Observability for AI Infrastructure: What to Monitor Beyond CPU and Memory

Observability tells us whether an AI platform is healthy.

But it also reveals another important question:

How much are we paying to keep it healthy?

AI introduces a cost model that is more dynamic than many traditional cloud applications.

A team may be paying for:

GPU capacity
Model API tokens
Inference endpoints
Vector databases
Storage
Network traffic
Observability
Data processing
Enter fullscreen mode Exit fullscreen mode

And those costs can change depending on user traffic, model choice, prompt size, GPU utilization, and architecture.

This is where FinOps for AI becomes important.

The goal is not simply to reduce the cloud bill.

It is to understand the relationship between:

Usage
   ↓
Performance
   ↓
Cost
   ↓
Business Value
Enter fullscreen mode Exit fullscreen mode

Why AI Costs Are Different

Traditional cloud workloads often have relatively familiar cost drivers:

Virtual machines
Containers
Storage
Databases
Network traffic
Enter fullscreen mode Exit fullscreen mode

AI adds new units of consumption.

For hosted models, cost may depend on things such as:

Input tokens
Output tokens
Model selection
Number of requests
Cached vs uncached requests
Enter fullscreen mode Exit fullscreen mode

For self-hosted AI, the cost model changes again:

GPU hours
GPU utilization
Model replicas
Storage
Networking
Powerful compute nodes
Enter fullscreen mode Exit fullscreen mode

The FinOps Foundation describes AI as a distinct technology category because its usage can be highly granular, unpredictable, and spread across cloud platforms, model providers, SaaS services, and private infrastructure.

That makes cost attribution more difficult.

There Are Two Common AI Cost Models

At a high level, most production AI systems fall somewhere between two models.

Model 1: Managed AI APIs

The architecture might look like:

Application
     ↓
Model API
     ↓
Provider-hosted Model
Enter fullscreen mode Exit fullscreen mode

The organization does not manage GPUs directly.

Instead, it pays based on consumption.

Typical cost drivers include:

Input tokens
Output tokens
Requests
Model tier
Embeddings
Additional API features
Enter fullscreen mode Exit fullscreen mode

Model 2: Self-Hosted Inference

The architecture might look like:

Application
     ↓
Kubernetes
     ↓
Model Server
     ↓
GPU Nodes
Enter fullscreen mode Exit fullscreen mode

Now the organization owns more of the infrastructure responsibility.

Cost drivers include:

GPU node hours
Idle GPU capacity
Number of replicas
Storage
Networking
Kubernetes infrastructure
Monitoring
Engineering overhead
Enter fullscreen mode Exit fullscreen mode

Neither approach is automatically cheaper.

The right choice depends on workload size, predictability, performance requirements, operational capability, and utilization.

Token Economics

For API-based AI systems, tokens become one of the most important units of consumption.

A simplified request might look like:

User Prompt
     ↓
Input Tokens
     ↓
Model
     ↓
Output Tokens
Enter fullscreen mode Exit fullscreen mode

Now imagine an application processing thousands or millions of these requests.

Small changes in prompt size or output length can begin to matter.

For example:

Request A
Input: 500 tokens
Output: 200 tokens

Request B
Input: 5,000 tokens
Output: 1,500 tokens
Enter fullscreen mode Exit fullscreen mode

Both are technically one request.

But they represent very different amounts of model consumption.

This is why request count alone is not enough for AI cost monitoring.

The FinOps Foundation increasingly describes tokens as a fundamental unit for understanding AI consumption and value.

Useful metrics include:

Tokens per request
Tokens per user
Tokens per feature
Tokens per tenant
Cost per request
Cost per successful task
Enter fullscreen mode Exit fullscreen mode

That last metric is especially important.

Because the cheapest request is not necessarily the most valuable one.

Model Choice Has a Cost Impact

Not every request requires the most capable model available.

Consider an application that performs:

Document classification
Summarization
Code generation
Complex reasoning
Simple extraction
Enter fullscreen mode Exit fullscreen mode

Using the same large model for every task may be unnecessary.

A routing layer can choose a model based on the request:

Incoming Request
       ↓
Task Classification
       ↓
┌────────────┬─────────────┐
↓            ↓             ↓
Small Model  Medium Model  Large Model
Enter fullscreen mode Exit fullscreen mode

This can balance:

Quality
Latency
Cost
Enter fullscreen mode Exit fullscreen mode

Microsoft's current guidance for AI cost optimization specifically highlights model selection and routing as important cost levers, alongside caching and batching.

The objective is not:

Always choose the cheapest model.

It is:

Use the least expensive model that can meet the required quality and reliability.

Prompt Size Matters

AI applications often send more context than users realize.

A request may contain:

System prompt
Conversation history
Retrieved documents
Tool descriptions
User input
Enter fullscreen mode Exit fullscreen mode

That can become a large input.

For example:

User message:           100 tokens
System instructions:    500 tokens
Conversation history: 3,000 tokens
Retrieved documents:  6,000 tokens

Total input:           9,600 tokens
Enter fullscreen mode Exit fullscreen mode

The visible user request may be small, but the actual model request is much larger.

This is why teams should monitor:

Average input tokens
Average output tokens
Context size
Retrieved document volume
Tokens by feature
Enter fullscreen mode Exit fullscreen mode

Prompt design becomes both a performance and cost concern.

Caching Can Reduce Repeated Work

Some AI requests repeatedly process the same information.

Examples include:

System instructions
Frequently accessed documents
Repeated embeddings
Common queries
Static context
Enter fullscreen mode Exit fullscreen mode

Caching can reduce unnecessary processing.

Conceptually:

Request
   ↓
Cache available?
   ↓
Yes → Reuse result
   ↓
No → Call model/service
Enter fullscreen mode Exit fullscreen mode

Different forms of caching may include:

Prompt caching
Semantic caching
Embedding caching
Application caching
Enter fullscreen mode Exit fullscreen mode

Caching should be used carefully because stale or incorrect results can create quality problems.

But when the workload contains repeated computation, it can significantly improve efficiency.

Microsoft also lists caching as one of the core request-path levers for reducing AI workload cost.

GPU Utilization Is a Financial Metric

For self-hosted inference, GPU utilization is not only an observability metric.

It directly affects cost efficiency.

Imagine two GPU clusters:

Cluster A
GPU utilization: 80%

Cluster B
GPU utilization: 20%
Enter fullscreen mode Exit fullscreen mode

If both use similar hardware and run for the same number of hours, Cluster B is likely delivering much less useful work for the same infrastructure commitment.

But high utilization is not automatically better either.

Consider:

GPU utilization: 100%
Queue depth:      Growing
Latency:          Increasing
Enter fullscreen mode Exit fullscreen mode

The infrastructure may be efficient financially while delivering poor user experience.

The real objective is to find the right balance:

High utilization
      +
Acceptable latency
      +
Reliable throughput
Enter fullscreen mode Exit fullscreen mode

That is much more useful than optimizing cost in isolation.

Cost Per Request Is Better Than Total Spend

Suppose the monthly AI infrastructure bill grows:

Month 1: $10,000
Month 2: $15,000
Enter fullscreen mode Exit fullscreen mode

At first glance, cost increased by 50%.

But imagine usage also changed:

Month 1
100,000 requests

Month 2
300,000 requests
Enter fullscreen mode Exit fullscreen mode

Now the picture looks very different.

Instead of only measuring total spend, track unit economics.

Examples:

Cost per request
Cost per 1,000 tokens
Cost per active user
Cost per document processed
Cost per successful AI task
Cost per tenant
Enter fullscreen mode Exit fullscreen mode

Unit cost helps teams determine whether growth in spending represents waste or simply increased business usage.

Tag AI Infrastructure Early

Cost analysis becomes difficult when everything appears as a single cloud bill.

Resources should carry business context.

A useful tagging model could include:

team       = platform
environment = production
workload   = inference
model      = model-a
tenant     = customer-42
project    = ai-assistant
Enter fullscreen mode Exit fullscreen mode

This allows teams to ask:

Which team owns this cost?

Which environment is generating it?

Which workload consumes the most?

Which customer is driving usage?
Enter fullscreen mode Exit fullscreen mode

Microsoft recommends tagging AI resources by dimensions such as workload, tenant, environment, cost center, and team so spend can be allocated and analyzed more accurately.

Without allocation, optimization becomes guesswork.

Build an AI Cost Dashboard

A useful AI FinOps dashboard should combine infrastructure and application metrics.

For example:

AI COST DASHBOARD

Model API
├── Input tokens
├── Output tokens
├── Requests
└── Cost per request

GPU
├── GPU hours
├── Utilization
├── Idle capacity
└── Cost per GPU hour

Application
├── Requests
├── Active users
├── Successful tasks
└── Cost per feature

Business
├── Cost per tenant
├── Cost per user
└── Cost per successful outcome
Enter fullscreen mode Exit fullscreen mode

The goal is to connect technical consumption with business activity.

A graph showing only:

Cloud spend = $27,842
Enter fullscreen mode Exit fullscreen mode

does not tell engineers what to change.

A graph showing:

Document summarization
Cost per successful request ↑ 42%
Enter fullscreen mode Exit fullscreen mode

gives the team somewhere to investigate.

Set Budgets and Detect Anomalies

AI traffic can change quickly.

That makes anomaly detection useful.

For example:

Normal daily AI spend
$500

Today
$1,900
Enter fullscreen mode Exit fullscreen mode

Possible causes might include:

Traffic spike
Application bug
Retry loop
Unexpected token growth
New tenant workload
GPU left running
Model routing change
Enter fullscreen mode Exit fullscreen mode

Cloud cost-management platforms can provide budgets and anomaly alerts, while application-level metrics can explain what actually caused the increase.

Microsoft's current AI governance guidance recommends budgets, cost alerts, anomaly detection, and regular analysis of spending patterns for AI workloads.

Common AI Cost Waste

Some common sources of unnecessary spending include:

Idle GPUs
Oversized GPU nodes
Too many inference replicas
Unnecessarily large models
Very large prompts
Repeated embeddings
Unused development environments
Aggressive retries
Unbounded output generation
Poor workload allocation
Enter fullscreen mode Exit fullscreen mode

Notice how many of these are engineering decisions.

That is why FinOps is not simply a finance-team responsibility.

It requires collaboration between:

Engineering
Platform teams
FinOps
Product
Finance
Business owners
Enter fullscreen mode Exit fullscreen mode

Performance and Cost Must Be Optimized Together

Imagine reducing inference capacity by half.

The bill drops.

But latency changes from:

2 seconds
    ↓
14 seconds
Enter fullscreen mode Exit fullscreen mode

That is not necessarily an optimization.

Likewise, doubling GPUs may improve latency but make the economics unsustainable.

A better model is:

            Cost
             ↑
             |
Performance ←→ Value
Enter fullscreen mode Exit fullscreen mode

Cloud engineers need to balance all three.

For an AI platform, useful targets may include:

Latency SLO
Availability SLO
Cost per request
GPU utilization target
Quality threshold
Enter fullscreen mode Exit fullscreen mode

An optimization is successful when cost improves without violating the service objectives that matter to users.

Practical AI FinOps Checklist

Before scaling an AI workload, ask:

  • Can we attribute cost to a workload or team?
  • Do we know the cost per request or task?
  • Are token volumes being measured?
  • Are large prompts actually necessary?
  • Are different tasks routed to appropriate models?
  • Are GPUs efficiently utilized?
  • Are idle development resources being removed?
  • Do we have budgets and anomaly alerts?
  • Are performance and cost reviewed together?

If you cannot answer these questions, scaling the platform will probably scale the uncertainty around the bill as well.

What's Next?

So far in this series we have covered:

Kubernetes
     ↓
GPU Scheduling
     ↓
Model Serving
     ↓
Observability
     ↓
FinOps
Enter fullscreen mode Exit fullscreen mode

There is one final question:

How do we bring all of these pieces together into a production AI platform?

That is what we will cover in Part 5:

Building a Production AI Platform: Kubernetes, GitOps, IaC, Security, and Observability

We will connect the infrastructure, deployment, security, monitoring, and cost-management layers into one practical architecture.

Final Thoughts

AI infrastructure changes cloud economics because the consumption model itself is different.

We are no longer measuring only:

CPU
Memory
Storage
Enter fullscreen mode Exit fullscreen mode

We may also need to understand:

GPU hours
Tokens
Inference volume
Model selection
Queue depth
Tenant usage
Cost per successful task
Enter fullscreen mode Exit fullscreen mode

The most important shift is moving from:

How much does our AI platform cost?

to:

What value are we getting from each unit of AI infrastructure we consume?

That is the real purpose of FinOps for AI.

Not simply spending less.

But making better engineering decisions about where AI infrastructure delivers value.

Thanks for Reading

This article is Part 4 of my AI Infrastructure for Cloud Engineers series:

  1. Why Kubernetes Is Becoming the Operating System for AI Infrastructure
  2. Running AI Workloads on Kubernetes: GPUs, Scheduling, Scaling, and Model Serving
  3. Observability for AI Infrastructure: What to Monitor Beyond CPU and Memory
  4. FinOps for AI: Understanding GPU, Token, and Inference Costs
  5. Coming next: Building a Production AI Platform: Kubernetes, GitOps, IaC, Security, and Observability

I regularly share what I learn about cloud infrastructure, Kubernetes, DevOps, SRE, FinOps, and the engineering behind production AI systems.

LinkedIn: Connect with me on LinkedIn

If you're managing AI workloads today, which cost is the hardest to predict: GPU capacity, token usage, model APIs, or something else?

Top comments (0)