Academy › Projects › Common foundation: set up once, use in every project

Common foundation: set up once, use in every project

Tools to install: Python 3.11+, VS Code, Git + GitHub, Docker Desktop, an Azure free account (or OpenAI/Anthropic API keys), and Node.js (for front-ends).

Standard project structure:

project/
  app/            # API (FastAPI)
  core/           # prompts, chains, agents
  guardrails/     # input/output checks
  evals/          # test datasets + scoring
  infra/          # Dockerfile, Bicep/Terraform
  .github/workflows/ci.yml
  README.md       # architecture diagram + how to run

Baseline stack: FastAPI · LangChain/LangGraph · Azure OpenAI (or any LLM) · Azure AI Search / Qdrant / pgvector · Langfuse or Azure App Insights for tracing · Docker · GitHub Actions · Azure Container Apps.

The 7 production pillars (apply to every project):

  1. Security: secrets in Key Vault or .env (never in Git), Managed Identity, private endpoints.
  2. Guardrails: input validation, prompt-injection detection, PII masking, output moderation, grounding checks.
  3. Evals: a golden dataset (30–100 Q&A pairs) and automated scoring (faithfulness, relevance, correctness) in CI.
  4. Observability: trace every LLM call (prompt, tokens, latency, cost, user id).
  5. Cost control: caching, model routing (small model first), token limits, budgets/alerts.
  6. Reliability: retries with backoff, timeouts, fallback model, rate limiting.
  7. Governance: audit log, data retention policy, model card, human-in-the-loop for risky actions.