Serving Qwen via AWS Lambdas for fun and 80x negative profit

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

Comments

catlifeonmarsNov 25, 2026, 4:16 AM
I’m sure it’s still quite expensive but lambda can now access GPU instances via managed instances. I’d like to see the same thing implemented on some beefier GPU compute.

https://docs.aws.amazon.com/lambda/latest/dg/lambda-managed-...

alex_dufNov 25, 2026, 8:57 AM
Reading this, it's almost what I need, but not quite.

Why do I have to worry about it provisioning GPU instances in my account? That kinda breaks the mental model of lambdas. It feels like a billing constraint turned into a technical constraint. Then you wonder how well is it going to scale up and down to follow the load I'm giving it, which is supposed to be their problem to worry about, not mine.

octemberNov 25, 2026, 4:28 AM
God damn it, nerd sniped again. ill be back
geophphNov 25, 2026, 5:14 AM
Hell yeah
iknownothowNov 25, 2026, 11:42 AM
Keep in mind that AWS Lambda has different performance characteristics based on how much memory you provide it.

1. For example a 10GB instance may have access to 6-ish cores. Also lambda instances under 1.3GB tend to have slower cores. [1].

2. There's the new aws managed lambda instances that can allow 32GB and 16vCPU instances [2]

3. Larger lambdas tend to have more network bandwidth so may be downloading layers from S3 might be faster [3]

Do you think it would make sense to stuff two or more layers into a larger lambda instances given that there's multiple cores and more memory available? I wouldn't be surprised if some optimizations would lead to only 20x negative profit :)

[1] https://aws.amazon.com/blogs/compute/optimizing-compute-inte...

[2] https://aws.amazon.com/about-aws/whats-new/2026/03/lambda-32...

[3] https://aws.amazon.com/blogs/compute/improving-lambda-functi...

octemberNov 25, 2026, 4:19 PM
Yeah I did some optimizations I removed from the blog post, I did get it ~3x cheaper/faster doing some hill climbing. But the gap is pretty wide. feels like the best lever is GPU backed instances which im now testing
mkesperNov 25, 2026, 12:48 PM
Also ensure you're using the Graviton (arm64) lambdas.
cebertNov 25, 2026, 4:12 AM
I love it when folks experiment and try random approaches like this to see if it would even work.
octemberNov 25, 2026, 4:14 AM
LOL thank you. Learn by doing
bikemike026Nov 25, 2026, 3:43 PM
Same. Bravo!
enjoyyourlifeNov 25, 2026, 6:55 AM
Needs to try Cloudflare Workers next
tkmccNov 25, 2026, 7:53 PM
I have very tiny, super quantized models running in production on Cloudflare Workers, but at a certain point it's easier to just run them on the frontend. Too bad CF got rid of letting you use WebGPU.
syrusakbaryNov 25, 2026, 8:34 PM
Interesting, we will likely launch WebGPU support in Wasmer at some moment.

Do you know why they got rid of it?

hizlikovboy27Nov 25, 2026, 7:01 AM
I love this madness. Its serves as an answer to that "what if?" question you have been harboring all this time. Im looking forward to seeing your new experiments with AWS Lambda documentation :)
janalsncmNov 25, 2026, 5:28 AM
Hey that’s pretty impressive even if it’s not economical.

First thing that came to mind is that you’re using a 4B model. If you can get away with something half the size, I think the numbers will be more favorable.

In order to do that you need an eval set, which you’ll want anyways if you care whether Jev or Open AI decisions or Gemini decisions are best for your problem.

Another thing is, you’ll probably be crushed on cold start unless you deliberately keep your lambdas warm.

octemberNov 25, 2026, 5:36 AM
All good points! I did pick somewhat randomly - would be interesting to sweep. But at least in 2026 it doesn't seem like these smaller models are holding up. Maybe there is a sweet spot but I'm skeptical

For the eval set I took a sample from here: https://stanfordnlp.github.io/contract-nli/

If it's done right, answers are 100% identical so it's easy to verify you didn't break it

And yeah I kept them warm, pinging every function every 4 minutes

quiet_ledger44Nov 25, 2026, 2:58 PM
5600 functions, every 4 minutes? does the ping load the model?
octemberNov 25, 2026, 4:18 PM
Not 5,600 functions, more like ~100 (a few per layer). 5,600 is invocations per read. The first ping loads the layer's weights, after that it's basically a no-op since the instance keeps them warm
hawaiih1Nov 25, 2026, 11:27 AM
[flagged]
1106234989Nov 26, 2026, 1:08 AM
[flagged]
iknownothowNov 25, 2026, 11:21 AM
> splitting a model call across 5,600 Lambdas is kinda wild.

100% wild! Absolutely amazing idea and implementation! The advantage (theorectical) I see with this approach is that you can run an abritrarily large open model yourself using this approach without having access to a large machine or GPU*.

* When cost, speed and practicality are of no concern :D

Do you know if a diffusion model lends itself better to this approach? Since token generation may not be serial?

jdw64Nov 25, 2026, 4:25 AM
>I need a GPU Who wouldn’t need a GPU? We all need one.
arbor-groupNov 25, 2026, 2:57 PM
[flagged]
velocitixagencyNov 25, 2026, 1:00 PM
[flagged]
lemonbanan4Nov 25, 2026, 3:52 PM
[flagged]
kooyuNov 25, 2026, 9:24 AM
[flagged]