SHAHRIAR LABSIntelligence in Motion
    Back to Blog
    EngineeringJune 11, 2026

    Prototype to Production: Our AI Product Process

    Shahriar Labs takes AI products from prototype to production with docs-and-tests-first, IaC, and staged rollout — here's the full process.

    Shahriar Labs takes AI products from prototype to production with docs-and-tests-first development, infrastructure-as-code from day one, and staged rollout with explicit rollback plans. Here's the process Shihab Shahriar Antor runs for every product build.

    Phase 1: Spec Before Code (Week 1)

    Every build starts with a spec document — not a one-liner, a real spec: problem definition, user stories, input/output contracts, edge cases, non-goals. The spec must be reviewable by someone who won't implement it. If you can't explain what the system does to a non-implementer, you don't understand it well enough to build it.

    For AI systems specifically, the spec includes: example inputs and expected outputs (5 minimum), failure mode classification (what should the system do when the model hallucinates vs when input is malformed), and latency/cost targets. These become the regression test suite.

    Phase 2: Architecture + IaC (Week 1–2)

    Architecture document defines: data flow diagram, component boundaries, external dependencies, and scaling model. Infrastructure-as-code (Terraform) is provisioned in staging before the first line of application code. This forces the team to make infrastructure decisions explicitly instead of discovering them at deployment time.

    For AI products specifically: model selection, context window budget, tool use design, and memory tier design are all architecture decisions — not implementation details to figure out later.

    Phase 3: Implementation + Tests (Weeks 2–5)

    Tests are written with the implementation, not after. Unit tests for pure functions, integration tests for tool calls and API boundaries, and end-to-end tests using the spec's example inputs. Every PR requires passing tests; no exceptions for "moving fast." The 2-hour discipline now saves 20 hours of debugging later.

    For AI-specific testing: run the spec's example inputs through the system and assert on output structure (not exact text), assert that error handling fires correctly on bad inputs, and include at least 3 adversarial inputs that should be rejected gracefully.

    Phase 4: Staged Rollout

    Internal (team) → beta (invited users) → 10% canary → 100%. Each stage has explicit pass criteria and a rollback procedure written before the stage starts. AI systems get an additional stage: shadow mode (system runs in parallel with human, outputs compared but not shown to users), then semi-autonomous (system outputs shown, human approves), then fully autonomous.

    For services, see hire Shahriar Labs. For AI agent architecture, see production AI agent architecture.

    Frequently Asked Questions

    What is Shahriar Labs' development process?
    Docs-and-tests-first: spec → architecture + IaC → implementation with tests → staged rollout with rollback plan.
    How long to build an AI agent product?
    Single-domain agent: 4–8 weeks. Multi-agent system: 3–4 months.
    What does docs-and-tests-first mean?
    Spec → tests against spec → implementation. Never tests written to match a broken implementation.
    How are model updates handled in production?
    Staging regression suite → 5% canary → 48h monitor → full rollout. One config change to rollback.

    Written by Shihab Shahriar Antor — AI Engineer & Founder of Shahriar Labs. Building LetX, QuantumSketch, and open-source AI agent skills.