Case Studies

5,600 AWS Lambdas Running Qwen Cost 80x More

A project deployed Qwen across roughly 5,600 AWS Lambda instances and proved the service could scale, but also generated losses of about 80 times revenue. The experiment highlights how cold starts, model loading, and low utilization can undermine the economics of serverless LLM inference.

Font size

Noah Built deployed Qwen using approximately 5,600 AWS Lambda instances. The service worked, but it produced a loss of roughly 80 times revenue. This article breaks down the costs and explains how teams should evaluate cloud-based LLM inference economics.

What 5,600 Lambdas Actually Did

The project's goal was straightforward: deploy Qwen with AWS Lambda to determine whether large-scale, ephemeral model serving was viable and what it would actually cost.

The deployment reached a scale of roughly 5,600 Lambda instances.

The important point was not that Lambda was inherently special. Its value was that it allowed model serving to be treated as a collection of short-lived functions. Instances launched when requests arrived and shut down when demand subsided, without requiring the application to reserve GPUs continuously.

This approach follows a different logic from always-on GPU instances.

Persistent GPU instances work well for stable workloads. The machines remain running, the model loads once, and subsequent requests reuse it. At high utilization, the cost per request is usually amortized across many requests.

Lambda suits a different pattern: traffic suddenly increases and the service needs to spin up thousands of execution environments in a short time. Once the burst ends, those resources can be reclaimed. It buys elasticity rather than paying for idle time.

By choosing function-based computing, the project was effectively asking: if Qwen were exposed as a stateless API and scaled temporarily by a cloud provider, how much concurrency could the service support?

The answer was approximately 5,600 instances.

Why High Throughput Does Not Mean Low Cost

The problem becomes clear once the bill is broken into components.

The cost of a request is not limited to the number of tokens generated. At least four layers must be considered:

  1. Request scheduling and queueing;
  2. Lambda cold starts;
  3. Model loading and initialization;
  4. Actual execution, memory, duration, and data-transfer charges.

When the execution environment scales from a handful of instances to several thousand, many fixed costs become recurring marginal costs.

Model loading is the most obvious example. Qwen is not a few kilobytes of business logic. Every new Lambda environment incurs initialization time along with the associated CPU, memory, and execution charges. Higher concurrency means more launches and more repeated model loads.

Cold starts are more than a slower startup. They consume part of a request's time budget, potentially forcing clients to retry or requiring upstream systems to reserve larger timeout windows and more redundancy. Once retries amplify concurrency, the number of billable requests no longer reflects the actual work performed.

The figure of 5,600 describes the system's ability to scale simultaneously, not its cost efficiency.

If each instance handles only a small number of requests on average, its startup and initialization cost is spread across very few tokens. Conversely, if traffic never remains high enough to keep all 5,600 instances busy, low utilization directly consumes the savings that elasticity was supposed to provide.

This produced the experiment's most striking contrast: the more impressive the instance count, the worse the economics became.

The experiment's objective also exposed its limitations. The authors wanted to know whether this service model could work, but peak-concurrency data alone cannot answer the commercial question of what one million tokens costs.

What an 80-Times Loss Reveals

The loss of approximately 80 times revenue was the figure most likely to attract attention.

It should not automatically be treated as the cost ratio for every Qwen deployment. The model's size, quantization method, context length, request mix, region, pricing, and traffic pattern can all change the result.

Even so, a loss on that scale shows that confusing “the service runs” with “the service is worth running” can be extremely expensive.

The costs most likely to be overlooked in stateless model serving are those that do not appear in an individual API call:

  • The startup overhead of many short-lived instances;
  • Repeated model loading in cold environments;
  • Queueing, timeouts, and retries under high concurrency;
  • Safety margins reserved to handle peak demand;
  • Scheduling and observability costs that remain during low-traffic periods.

A commercial service depends on long-term unit economics, not a flattering benchmark screenshot.

For workloads with pronounced bursts, Lambda's elasticity can offer real value. Teams do not pay for idle GPUs and can scale rapidly during peaks. That advantage holds only if the bursts are brief and caching, warming, and scheduling keep cold-start costs under control.

With sustained traffic, however, 5,600 Lambdas that continuously start, load the model, execute requests, and terminate lose their central advantage. The operator pays for persistent capacity and repeated startup costs at the same time.

The Limits of Self-Hosted Cloud Inference

Lambda and GPU inference services are not simply old and new architectures. The better choice depends on the workload.

Scenario Better Fit Primary Reason
Short, highly bursty traffic AWS Lambda Automatic resource reclamation and horizontal scaling at peak demand
Steady throughput with a large model GPU inference service The model remains loaded, avoiding repeated initialization and cold starts
Many Agent tool calls and short individual tasks Determine through latency testing Execution-environment and model-state considerations may matter more than token cost
Private data or custom models GPU instances or managed inference endpoints Greater control over network boundaries, model versions, and caching

Two questions need to be separated here.

First, can the architecture support the workload?

The answer is often yes. Lambda is flexible enough, and Qwen can be adapted into a model or task suitable for function execution. As long as latency, retries, and output consistency are handled, getting the service running is not technically difficult.

Second, do the unit economics work?

This is the threshold for commercial viability. The full cost must be calculated:

cost per request
= compute cost
+ cold-start and model-loading cost
+ scheduling and storage cost
+ retry and failure cost
+ operations cost

The result must also be divided by effective throughput rather than using “5,600 instances” as the numerator.

A more useful approach is to load-test several request volumes instead of reporting maximum concurrency alone:

  • 10, 100, 1,000, and 5,000 requests per minute;
  • Different ratios of input to output tokens;
  • Burst durations of 10 seconds, 1 minute, and 10 minutes;
  • Scenarios with and without cache hits;
  • Separate rates for failures, timeouts, and retries.

Each metric should then be mapped to the complete bill. Only then can a team determine whether Lambda is smoothing peak demand or creating an oversized bill.

Editorial Takeaways

The significance of running 5,600 Lambdas extends beyond proving that distributed inference works. Peak concurrency can easily obscure weaknesses in unit economics. Previous comparisons of self-hosted LLMs commonly focused on GPU prices, tokens per second, and quantization accuracy. This experiment adds another dimension: startup, loading, and low utilization within a function's lifecycle can also push costs beyond revenue.

AI Agents are likely to amplify this problem because tool calls create more short tasks, while conventional token-based pricing does not account for scheduling and execution-environment costs. That makes the test more representative of an entire service lifecycle than a conventional single-model, single-request, sustained-load benchmark.

The precise causes of the 80-times loss remain uncertain. It is not yet clear whether low traffic, the model-loading approach, or the accounting methodology was primarily responsible. Determining whether the service is commercially viable will also require the request curve, caching strategy, and a line-by-line cost breakdown.

Source: https://noahbuilt.it/writing/qwen-on-5600-lambdas

Source: https://noahbuilt.it/writing/qwen-on-5600-lambdas