Qwen on 5,600 AWS Lambda Functions Reads 4,000 Tokens in 17 Seconds and Costs 80x More Than Google
A developer tested whether Qwen could run on AWS Lambda, cloud functions usually used to parallelize tasks like ffmpeg. The model weighs 9.3 GB against a 3 GB function limit, so he split it into 32 layers, and a single request turned into 5,600 calls. A 4,000-token document took 17 seconds and cost 3.4 cents: $8.40 per million tokens versus $0.10 from Google, making it more than 80 times more expensive. His conclusion: matrix math needs GPUs, and running it on CPUs offers no savings.
AI-processed from Hacker News AI; edited by Hamidun News
AWS Lambda is a cloud functions service: you pay only for the seconds of execution, and you can launch thousands of copies at once. For tasks like cutting long video with ffmpeg, it's an ideal tool. One developer asked: what if we distributed a language model's work across functions the same way and skipped expensive GPUs? He built a prototype and got an honest negative result. Qwen, running across 5,600 Lambda calls, read a 4,000-token document in 17 seconds and cost 3.4 cents. That's $8.40 per million tokens, while Google's ready-made model charges $0.10, so the same work there costs 0.04 cents. The gap is more than 80x.
How the model was cut into pieces
The author took Qwen3.5-4B, his own fine-tuned version built for "decision" tasks. Such a model reads a document and answers a question by choosing one of several predefined options. That requires a single forward pass without generating long text, so the task was the best fit for the experiment.
The main problem was size. The whole model weighs 9.3 GB, while the author deliberately kept the Lambda limit at 3 GB. But the network has 32 layers of roughly 225 MB each, and one layer fits into a function. That gave the scheme: one function processes one layer for one block of tokens.
Imagine an assembly line of 32 machines, with the document cut into portions. Each function is a simple idempotent API: it reads from S3 the output of the previous layer for its portion, takes the state from the previous portion at the same layer, computes, and writes a single object back to S3. The work proceeds in a staircase pattern: each layer starts one step after the previous one. By the author's estimate, 92% of the work can run in parallel, while 8% has to run strictly in sequence. He got the idea from Remotion, which renders video on massively parallel Lambda functions. In the end, one request became 5,600 calls, and the math checked out.
Why it didn't work
The author himself says that if the scheme had been 40 times slower but half the cost, it would still be worth discussing. But it turned out to be both slow and expensive.
The reason is that one layer over several thousand tokens is an enormous matrix multiplication. GPUs were built for exactly this kind of work. Lambda provides only CPU time, and CPU time costs real money. Add the overhead: loading layer weights into each function, writing and reading intermediate results to S3, and waiting on dependent tasks. In the end, according to the author, "CPU still costs dollars, there's no arbitrage here." Splitting the work across thousands of functions doesn't make a CPU second any cheaper.
What to take from this
First, serverless parallelism works well where the pieces are independent: video, file processing, bulk parsing. In transformers, layers depend on one another, and the load consists of matrix arithmetic, so this scheme doesn't suit them.
Second, if you need a small classifier or a "decision" model, first compare the prices of managed APIs. At $0.10 per million tokens, running your own infrastructure is justified only under special requirements: data privacy, deep customization, or large, steady volumes on your own GPUs.
Third, there's a pleasant side conclusion. The author calls himself an ordinary applied developer, not a model specialist, yet he worked with layers through the transformers library API without difficulty. In his view, in 2026 open models are simply another API you can experiment with without deep preparation.
Limitations: this is one person's personal experiment on a single fine-tuned model, not an independent benchmark. The figures are tied to a specific configuration with a 3 GB limit per function. But the general lesson stands: you can run a model on Lambda, but buying a GPU or using a ready-made API is cheaper.
- Nov 25, 2026Epochal Gives AI Agents a "Time Machine" Built from a Trillion Pages of the 1990s Internet
- Nov 25, 2026PrismML Shrinks a 54 GB Model to 5.9 GB, and It Now Solves 75.6% of Code-Fixing Tasks, Up from 60.8%
- Nov 25, 2026Gemini 4 Neon Beats the Flagship Carbon and Solves the Task At Half the Cost of Opus 5.5
- Nov 25, 2026Claude at $100 Gives 4,600 Calls, but Sol Finds More Bugs per Dollar
Key Questions Answered
How the model was cut into pieces?
The author took Qwen3.5-4B, his own fine-tuned version built for "decision" tasks. Such a model reads a document and answers a question by choosing one of several predefined options. That requires a single forward pass without generating long text, so the task was the best fit for the experiment. The main problem was size. The whole model weighs 9.3 GB, while the author deliberately kept the Lambda limit at 3 GB. But the network has 32 layers of roughly 225 MB each, and one layer fits into a function.
Why it didn't work?
The author himself says that if the scheme had been 40 times slower but half the cost, it would still be worth discussing. But it turned out to be both slow and expensive. The reason is that one layer over several thousand tokens is an enormous matrix multiplication. GPUs were built for exactly this kind of work. Lambda provides only CPU time, and CPU time costs real money. Add the overhead: loading layer weights into each function, writing and reading intermediate results to S3, and waiting on dependent tasks.
What to take from this?
First, serverless parallelism works well where the pieces are independent: video, file processing, bulk parsing. In transformers, layers depend on one another, and the load consists of matrix arithmetic, so this scheme doesn't suit them. Second, if you need a small classifier or a "decision" model, first compare the prices of managed APIs.
Test Frontier LLMs & Autonomous Agents in One Workspace
Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.
Waitlist: free vibecoding intensive + AI digest
Leave your email to reserve a spot in the free 2-day intensive and get the AI stories that matter.