Wednesday, November 25, 2026
News

Is AWS Lambda a cheap way to serve a small LLM?

A 4,000-token read took 17 seconds and 3.4 cents. AWS added a GPU option to Lambda on November 18, which the author calls the best lever.

A close up of a computer in a dark room

No, not on standard Lambda. Noah Lindner split a Qwen3.5-4B fine-tune across about 5,600 Lambda invocations per read. A 4,000-token document took 17 seconds and cost 3.4 cents, roughly $8.40 per million tokens against Lindner's hosted comparison price of $0.10. AWS added GPU instances to Lambda Managed Instances on November 18.

What did the Lambda Qwen experiment test?

It tested whether a self-hosted model can run on CPU-only Lambda by splitting it across functions. Lindner picked H2O-Lightning, a Qwen3.5-4B fine-tune built to read a document and answer a question by choosing one option. The model weighs 9.3 GB and is built from 32 layers, each around 225 MB. He set his own cap of 3 GB per function, so each Lambda job ran one layer over one block of tokens, took its input from S3 and wrote one object back. One read became 5,673 jobs, and each layer begins roughly a third of a second behind the layer above it. He puts the parallel share of the work at 92%. The post drew 123 points and 18 comments on Hacker News about 13 hours after it was submitted.

How much did it cost compared with a hosted model?

It cost about 80 times more. A 4,000-token read took 17 seconds and 3.4 cents, which Lindner states as $8.40 per million tokens. He sets that against Google's hosted Gemini Decision 1 at $0.10 per million tokens, where the same read costs 0.04 cents. Divided out, $8.40 against $0.10 is 84 times. In the comments he says tuning he left out of the post made the setup about 3x cheaper and faster. Taken at face value, that is $2.80 per million tokens, still about 28 times the hosted price. His own conclusion is that a layer applied to a few thousand tokens is a large matrix multiplication, which is GPU work.

A PromptZone summary published the same morning describes a different model (Qwen 2.5-Coder-1.5B), shared EFS storage and a cost of $6.00 per 1,000 requests. None of that appears in Lindner's post, so this story uses the post.

What do Lambda's limits and prices mean for this design?

The duration charge drives the bill, and the 3 GB cap was a choice, not a platform limit. Lambda functions can take 128 MB to 10,240 MB of memory, which is more than three times the cap Lindner set, and CPU scales with memory, reaching one vCPU's worth at 1,769 MB. One invocation can run for 30 minutes. The default quota is 1,000 concurrent executions, each function can add 1,000 execution environments every 10 seconds, and new accounts start with lower concurrency and memory quotas.

On price, AWS lists $0.0000166667 per GB-second on x86 and $0.0000133334 on Arm in US East (Ohio), plus $0.20 per million requests. The free tier is one million requests and 400,000 GB-seconds a month. At that request rate, the 5,673 invocations in one read carry about 0.11 cents of request fees out of the 3.4 cents. Arm's per-GB-second price is 20% lower than x86, and one commenter recommended it.

Does AWS's GPU option for Lambda change the picture?

It gives Lambda a GPU path that AWS aims at custom-model inference. On November 18 AWS announced that Event Functions on Lambda Managed Instances can run on EC2 G-series GPU instances. The announcement names decision models and small-to-mid-size language models among the workloads, and says the feature suits custom models more than the large foundation models already on Amazon Bedrock.

Billing is the EC2 instance fee plus a 9.75 percent management fee and the standard $0.20 per million requests. GPU functions take 3 to 48 GB of accelerator memory, 2,048 to 32,768 MB of function memory, container images up to 32 GB and as many as 48 requests at once in each execution environment. AWS's demo served Qwen2.5-1.5B-Instruct on the vLLM base image with 16,384 MB of memory and went from a model ID to a live endpoint in about 10 minutes. Four concurrent requests finished in about the time of one. Lindner says he is now testing GPU-backed instances.

What did Hacker News commenters suggest?

They pointed to memory sizing, Arm, smaller models and warm functions. One commenter noted that functions under 1.3 GB tend to get slower cores, and that larger ones tend to get more network bandwidth. Others recommended Graviton. Lindner keeps about 100 functions warm, a few per layer, by pinging each every 4 minutes. The first ping loads a layer's weights, and later pings do almost nothing. Another commenter objected that GPU Lambda makes users provision GPU instances in their own account, which departs from the usual Lambda model.

What should IT teams check before running a model on Lambda?

Price the invocation count first, because Lambda bills every job and every GB-second, and a layered split multiplies both.

  • Multiply invocations per request by $0.20 per million, then add duration at your memory size. The 5,673 jobs in this test carried about 0.11 cents in request fees, so duration is where the money goes.
  • Test Arm for the same function where your runtime allows it, since AWS prices its GB-seconds 20% lower.
  • Check your Region's concurrency quota (default 1,000) and the 10,240 MB memory ceiling before designing a fan-out. New accounts start lower.
  • For the GPU route, request a G-series instance quota first, because new accounts might start at 0. When testing ends, remove the function first and the capacity provider second, so the GPU instances stop billing.
  • Keep a hosted API as the baseline and compare per-million-token prices before self-hosting. The hosted price in Lindner's test was $0.10.
  • Count warm-up pings. 100 functions pinged every 4 minutes is about 1.1 million requests a month, above the free tier of one million.

Sources