Ship your reliable reasoning endpoint
Tip
Need step-by-step support?
Use the full Week 1 assignment guide (copy-paste prompts) here: Ship Your First AI Endpoint.
Ship the reasoning core for your capstone: a `POST /ask` endpoint that takes a question and returns a schema-validated answer, tokens used, and cost per call, with a guardrail that rejects malformed output and a model choice you can justify in one sentence. A notebook experiment does not count. A localhost-only server does not count. Done means a public HTTPS URL someone else can hit.
Tip
Start from the Week 1 starter repo
Clone or fork Week 1 /ask demo code (5 stages). Work through stages 1 to 5 (or jump to `main.py` once you understand each layer). Do not rebuild from scratch unless you have a strong reason.
1. Local first
- 1
Environment
Copy `.env.example` to `.env`, add `OPENAI_API_KEY`, install deps, activate your venv.
- 2
Run stage 5
`uvicorn main:app --host 127.0.0.1 --port 8000 --reload` (or `serve_stage5.py` if you are still stepping through).
- 3
Smoke test
Run `python test_all_stages.py` and curl locally until you get structured JSON with `answer`, `tokens_used`, and `cost_usd` every time.
- 4
Prove the guardrail
Trigger a bad output (the repo's `force_bad` knob on stage 3+) and confirm malformed responses are caught, not passed through.
2. Deploy on Render
- 1
Push to GitHub
Your fork of the starter (or your capstone repo with the same `/ask` contract) on a branch Render can build from.
- 2
Create a Web Service
On Render, connect the repo. Runtime: Python. Build: `pip install -r requirements.txt`. Start: `uvicorn main:app --host 0.0.0.0 --port $PORT`.
- 3
Set secrets
Add `OPENAI_API_KEY` in Render environment variables. Redeploy if you change them.
- 4
Wait for green
First deploy can take a few minutes. Note your public URL (e.g. `https://your-service.onrender.com`).
3. Prove it from outside your machine
Run curl against your live Render URL, not localhost. Paste the command and response in Maven or WhatsApp when you share.
Example
Live curl (replace the host)
curl -s -X POST https://YOUR-SERVICE.onrender.com/ask \ -H "Content-Type: application/json" \ -d '{"question": "What is RAG in one sentence?", "model": "gpt-4o-mini"}'
Critical
Not done until the public URL works
If only you can hit it on your laptop, it is not shipped. Week 2 attaches RAG to this endpoint - you need a stable public base URL.
4. Document your choices
- Which model you defaulted to and why (quality vs cost vs latency for your capstone domain).
- Approximate cost per call from a real live response (`cost_usd` in the JSON).
- What your guardrail does when validation fails (retry, safe default, or controlled error).
5. Get cohort feedback
Post in Maven Student Home → General submissions, or share in the cohort WhatsApp group (WhatsApp is best for quick feedback). Share your live URL, the curl command, and one specific ask. Reading how others structured their endpoint is the fastest way to sharpen your own.
6. Post on LinkedIn
Critical
Do NOT share your live URL publicly
Never paste your Render (or other) service URL on LinkedIn or anywhere public. Anyone with the link can hit your `/ask` endpoint and burn your OpenAI credits. Share the live URL only in Maven or the cohort WhatsApp group. On LinkedIn, use screenshots or a short screen recording only.
This assignment includes a LinkedIn post: public proof of what you shipped, how you learned, and credit for the programme. Tell the story of going from model call to reliable component. Use 2 to 4 screenshots or a 30 to 60 second screen recording showing your curl request, the structured JSON response, and optionally your Render deploy or guardrail catching bad output. No live URL in the post.
Your task
Copy, adapt, and post on LinkedIn
Week 1 of the Agentic AI Engineering Bootcamp with The AI Internship - I just shipped my first production LLM endpoint. What I built: POST /ask for [your capstone domain]. Question in, schema-validated answer out - with tokens_used and cost_usd on every call. What I learned: • A model call in a notebook is not a reliable component • Structured outputs turn free text into something downstream code can depend on • Guardrails catch malformed output before it reaches users • Model choice is an engineering tradeoff (quality vs cost vs latency) How I built it: forked the Week 1 starter repo, worked through stages 1-5 with [Cursor / Claude Code], deployed to Render, proved it with curl against my live URL. Outcome: [one sentence on your capstone reasoning core] - ~$[cost_usd] per call on [model name]. [Attach 2-4 screenshots or a 30-60s screen recording: terminal curl, JSON response with answer + tokens + cost, optional Render dashboard or guardrail demo. Do NOT paste your live service URL.] Cohort: feedback welcome in Maven / our WhatsApp group. #AgenticAI #AIEngineering #LLM #FastAPI #TheAIInternship
Done when
- Built from the Week 1 starter repo (stages 1-5 or `main.py`) and runs locally
- `python test_all_stages.py` passes (or equivalent smoke test you document)
- Deployed to Render (or equivalent) with a public HTTPS URL
- curl against the live URL returns schema-valid structured output
- Response includes `tokens_used` and `cost_usd` (or equivalent per-call cost)
- Guardrail rejects malformed output (show one failing case)
- You can state per-call cost and defend your model choice in one sentence
- LinkedIn post published with screenshots or a screen recording (no live URL), crediting Agentic AI Engineering Bootcamp / The AI Internship
Share in Maven or WhatsApp: Maven/WhatsApp only: live URL, curl command, model choice, and one ask. LinkedIn: screenshots only. Never post the live URL publicly.