Objective & prerequisites
Write an operating contract that distinguishes actual measurements from assumptions. Prerequisites: Python functions, JSON, lists and the existing API/testing foundations. Extract the full kit and open a terminal in applied-ai-kit. The core lab uses Python 3.10+ with no third-party dependencies or network. Actual new-text semantic inference is a separate optional local setup, tested on Python 3.12/macOS arm64. All CedarLab policies, invoices and review cases are fictional teaching material; they are not DataCareerHub service terms. No payment, registration, live chatbot or visitor-data collection is activated. These free companions do not change course progress or protected access.
python3 lab.py
python3 -m unittest discover -s tests -vUnderstand the concept
A local model still has operating costs and data-handling responsibilities. Document what leaves the device, what is retained, which model files execute, what is cached and how failures are surfaced. This kit’s explicit setup downloads public weights and packages but sends no source documents or queries to an inference provider. Actual encode.py uses only pinned local files. The core replay uses only the packaged fixture vectors and standard library. A future hosted provider needs explicit owner approval of data categories, endpoint, retention, budget, timeout, retry and failure rules; no such provider is implemented here. Zero paid API calls does not mean zero compute, storage or maintenance cost.
Worked example
The recorded initial CPU run encoded fifteen short texts in about 1.81 seconds including model setup/hash validation; it is one local observation, not a service-level promise or p95 latency. File sizes, SHA-256 hashes and immutable model revision are recorded. The ZIP excludes roughly 91 MB of model files and all installed Python dependencies. It includes saved vectors and an optional dependency inventory. Dependencies and model formats need maintenance review; a checksum verifies consistency with a recorded artifact, not perpetual safety or an independent security audit.
from lab import load
v=load("embeddings.json")
assert v["runtime"]["dimensions"]==384
assert v["runtime"]["provider"]=="CPUExecutionProvider"
assert v["runtime"]["silent_truncations"]==0Try it yourself
Complete privacy-cost-contract-template.txt for the current local workflow and a separate hypothetical hosted version. List transmitted data, retained artifacts, estimated resource use, permitted actions and unknowns. Run replay twice and explain why its elapsed time cannot be reported as model inference latency. If you install the optional runtime, record your actual versions and timing. Write your prediction, inspect the source and record actual results. Keep a copy of the original fixtures before making changes.
Worked solution
The current workflow has public setup downloads, local fictional inference, no external provider request and no paid token bill. Replay timings measure loading/scoring cached vectors, not generating embeddings. Real inference includes tokenization, model loading and CPU operations; report the measurement boundary and hardware. Future provider cost/latency/privacy remain unmeasured. Do not invent a provider price or claim an untested hosted adapter is ready.
Knowledge check
If replay takes 0.02 seconds, can you advertise that as the live model’s response time?
Check and explain
No. It is a different execution mode and measurement boundary. Report each mode accurately.
Evidence, mistakes & handover
Record the executed mode: actual local encoder, saved-vector replay, deterministic extraction or human factual review. They establish different things. Keep model/version, source hashes, commands, expected outcomes, failures and limitations with your work. Never turn a schema pass, cosine score or quotation into a claim of proven truth. The download contains a worksheet, independent controls, worked solutions, a factual-review rubric, privacy/cost contract and mini-project checklist. Credit the supplied starting point and describe your own contribution.
Authoritative reference
— official source for the underlying mechanism. Teaching prose and CedarLab cases are original. Model/runtime compatibility, licensing and operating limits require review for any later deployment; this course does not activate a production AI service.
Try the activity before reading its reference. Keep your sources, commands and assumptions with your work. Companion activities are unsaved self-practice and do not award a certificate or change lesson progress.