Hacker News

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

95 points by octember ago | 14 comments

iknownothow |next [-]

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...

mkesper |root |parent [-]

Also ensure you're using the Graviton (arm64) lambdas.

catlifeonmars |next |previous [-]

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_duf |root |parent |next [-]

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.

octember |root |parent |previous [-]

God damn it, nerd sniped again. ill be back

geophph |root |parent [-]

Hell yeah

cebert |next |previous [-]

I love it when folks experiment and try random approaches like this to see if it would even work.

octember |root |parent [-]

LOL thank you. Learn by doing

enjoyyourlife |next |previous [-]

Needs to try Cloudflare Workers next

hizlikovboy27 |next |previous [-]

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 :)

iknownothow |next |previous [-]

> 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?

janalsncm |next |previous [-]

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.

octember |root |parent |next [-]

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

hawaiih1 |root |parent |previous [-]

[flagged]

jdw64 |next |previous [-]

>I need a GPU Who wouldn’t need a GPU? We all need one.

velocitixagency |next |previous [-]

[flagged]

kooyu |previous [-]

[flagged]