Capstone 3 of 4
LLM-powered app
An app that calls a language model, with a fallback, deployed live.
Build an app that uses a language model to do something real: summarise a web page, or answer questions about a document you give it. Add a fallback so that if the first provider is busy or down, the app tries another or fails politely instead of crashing. Keep your API key in an environment variable, and deploy it live.
Before you submit
How to ship it
Deploy with secrets
- 1
Keep the key out of the code
Read your API key with os.environ, and add a .env to .gitignore so it never reaches GitHub.
- 2
Write the fallback
Wrap the model call so a failure (a timeout or an error) tries a second provider, or returns a plain message, rather than crashing the app.
- 3
Deploy to a free host
Deploy to Render or HuggingFace Spaces as in the Deployed app capstone, and add the API key as an environment variable in the host settings.
- 4
Test the live URL
Open the public URL and run the main feature once end to end to confirm the model responds in production.
Submit and verify
Paste your public links. PythonCook checks them and, if anything is not ready, tells you the exact next step.
