▣~/runthismodel▍
local AI explorer00:00:00Z
← Local AI: Zero to Hero

CHAPTER 12 OF 12

Ship a small service you can evaluate and recover

Combine the journey, monitor useful outcomes and make an explicit release decision.

In this chapter

Bring the pieces together

Your capstone is a small local deadline assistant with a defined input, a checked output, source retrieval and an authenticated API boundary. Its purpose is to demonstrate the entire reasoning process behind deployment. It is not a production service merely because a server process is running.

Write the release contract before the final run. Name the exact task, accepted input size, output schema, missing-information behavior, allowed model artifact, inference location and failure policy. Choose the evaluation cases and threshold in advance. Decide what the application does when an answer fails validation: reject it, ask for clarification or route it for human review. Silent guessing is not a recovery policy.

A release also needs an owner, a way to stop the service, a rollback artifact, a source of operational evidence and a plan for correcting bad information. Those requirements become more important as other people depend on the application.

Monitor outcomes and operations separately

Track request completion, error categories, latency, input/output sizes and resource pressure. Track useful outcomes with a task rubric or an appropriately designed user feedback process. A low error rate can coexist with consistently wrong answers. Conversely, a strict validator may reject many outputs while preventing incorrect data from entering the application.

For privacy, start with aggregate metrics and fictional synthetic checks. Do not collect entire prompts or documents by default simply because they make debugging easier. Define what is retained, who can read it and when it is removed. Public adoption and revenue claims require observed data, not counters added to a page.

The monitoring lab sends three synthetic requests and reports their median and errors. Three samples are not a production percentile, service-level guarantee or traffic baseline. Use it as a starting point for instrumentation, then design a realistic workload and observation period.

Prerequisites

Complete the earlier local chapters, keep the same runtime running, and retain all prior results. Cloud deployment and adapter training are optional branches; neither is required to run this local capstone.

Steps

  1. Write a release note naming the artifact and configuration you intend to demonstrate. Link the earlier failures rather than omitting them.

  2. Execute the capstone checks:

python3 rtm_lab.py project --output capstone.json
python3 rtm_lab.py monitor --output monitoring.json
  1. Inspect extraction, retrieval and access-control results independently. The reference capstone result is passed for a local demonstration. productionReady remains false.

  2. Run the development evaluation again, then a genuinely held-out set of your own. The book's 3/6 development result is a reason to keep the application narrowly supervised, even if its demonstration cases pass.

  3. Start the gateway from chapter 10 if you want to connect a small local client. Use its fixed loopback address, preserve explicit inference location and show rejected outputs as errors.

  4. Stop the gateway with Control-C. Unload the model and stop the lab runtime when finished. If you followed the cloud branch, perform that chapter's resource deletion and billing verification separately.

Expected results

You should have a release decision supported by raw reports, not just a screenshot of a successful answer. The capstone preserves a boolean for its limited local demonstration and a list of remaining production requirements. A failed gate means the application should not claim readiness for that gate.

The reference run demonstrates the plumbing and exposes the small model's limitations. The next model should be judged on the same task and held-out rubric, not chosen solely because it makes a single demonstration look better.

Recovery and rollback

Keep the previous known artifact, configuration and test report when updating. If a new version fails, stop accepting affected requests, restore the previous approved configuration and rerun its smoke checks. Preserve enough redacted diagnostics to explain the incident. Do not erase failures when replacing a model or prompt.

For a production deployment, add durable process supervision, TLS and identity integration where needed, resource and cost limits, monitoring alerts, backup/restore checks and a tested rollback procedure. Verify these in the actual target environment. The teaching gateway deliberately does not claim to provide them all.

Common failures

A health endpoint can respond while the model is unable to answer. A model can answer while every result violates the task contract. A new tag can resolve to a different artifact. A cloud instance can continue billing after the application stops. Test each condition at its own boundary.

Exercise

Write a one-page release decision with five fields: what works, what failed, what is unknown, who is responsible, and what evidence is needed next. If you would not let another person independently reproduce the decision, improve the record before calling the release complete.

Sources

The current lab evidence, shared artifact catalog and original first-run guide connect the capstone to the measured environment. Your production evidence must come from your actual deployment.