Shipping a vision-model verdict on Bedrock and Lightsail
Built 2026-08-15 against us.amazon.nova-lite-v1:0 via the Bedrock Converse API. FastAPI on Python 3.13, deployed to an Amazon Lightsail container service ( nano , scale 1) in us-east-1 . Scored against the live deployment, not localhost: 20/20 on the fixture set, median 880 ms per scan. Live: Dog or Not: Lite · Source: github.com/xbill9/dog-or-not-lite · Built for the AWS Weekend Challenge: Build a Creative App . TL;DR Make the model fill in a schema instead of writing a sentence. The Converse API's toolConfig plus toolChoice forces a named function call, so is_dog arrives as a boolean because it was declared as one. Every image comes back in the same shape — including the ambiguous ones, which is exactly where free-text output gets creative and a string-matching parser gets it wrong. The app is a webcam scanner that tells you whether the thing you are holding up is a dog. One HTML page, one POST /api/scan , one model call, no build step, no framework. The whole backend is 285 lines. Three AWS specifics are worth the price of admission: Lightsail container services have no IAM task role. There is nothing to attach a policy to, so the container needs a real access key as an environment variable. The mitigation is scope, not secrecy. A cross-region inference profile is authorized against every region it routes to. With the policy pinned to us-east-1 , a call made to us-east-1 was denied naming us-west-2 . Measured, not inferred. --platform linux/amd64 is not optional. An arm64 image builds, pushes and deploys cleanly, then crash-loops with an exec format error that never mentions architecture. And a mock mode that answers every scan locally is what made the frontend free to build — no credentials, no model access, no bill. 1. The shape: one route, one call The classification rule is the only opinionated part. is_dog is true only for a living domestic dog: a wolf is not a dog , nor is a coyote, fox, plush toy, bronze statue, cartoon, or person in a costume. That is a c