CIT AI Model Simulator
The CIT AI Model Simulator is a deterministic local service for CIT courses. It gives students who cannot run an approved local model a hardware-neutral fallback, and it gives students and instructors reproducible conditions for testing model-client behavior. It presents the small OpenAI-compatible HTTP surface used by the course without claiming to be an AI model or a complete llama.cpp replacement.
Responses come from versioned scenario state graphs rather than unrestricted text generation. The simulator labels its identity and all simulated timing and token evidence, listens only on the local computer by default, does not execute model-requested tools, and writes append-only evidence logs for debugging and course work.
The current implementation includes the M0/M1 Week 1 server baseline and the first data-driven interaction layer. Later-lab capabilities such as model-emitted tool calls, context shifting, compaction, protected validation, and evaluation reports remain deliberately incremental.
Install for development
python -m venv .venv-dev
.venv-dev\Scripts\python -m pip install -e .
On macOS or Linux, use .venv-dev/bin/python instead.
Start the simulator
cit-simulator serve
The default service URL is http://127.0.0.1:8081. Startup output identifies the backend, scenario, model alias, URL, and evidence directory.
Useful commands:
cit-simulator --help
cit-simulator validate
cit-simulator preview
cit-simulator test
cit-simulator serve --port 8081 --acceleration 20
cit-simulator run
cit-simulator run --harness
cit-simulator run starts a simple guided model-chat experience. It displays numbered choices from the active YAML file, labels the selected message as User Simulator Prompt:, and visually streams the deterministic response beneath Model Simulator Response:. Internal session, scenario, option-ID, and graph-state details are hidden unless --show-details is used.
The packaged Lab 1 interaction is a guided simulator orientation. Students can explore how predefined prompt choices and simulated responses work, learn the package's principal commands and display options, and finish with a hands-on practice checklist. It does not mention or require system prompts, tools, request packaging, or a student harness.
Each guided turn includes a concise Simulator Activity trace showing the logical prompt handoff, scenario match, and simulated response handoff. serve mode similarly reports incoming HTTP requests, scenario matches, and response statuses. --show-details expands guided activity with option and graph information, --verbose enables lower-level HTTP diagnostics, and --no-activity suppresses the learner-facing trace. --no-animation disables progressive terminal rendering for accessibility, logging, or automated use.
For later labs, harness mode lets a student implementation poll the session's user-input endpoint, add the selected canonical user message to its own system prompt, history, and tool definitions, and submit the resulting request to /v1/chat/completions. Later scenarios can reject unexpected packaging with structured, field-level differences.
Week 1 API
Learner-facing endpoints:
GET /healthGET /v1/healthGET /v1/modelsPOST /v1/chat/completionsPOST /v1/chat/completions/input_tokens
Simulator control endpoints:
GET /sim/v1/infoPOST /sim/v1/sessionsGET /sim/v1/sessions/{id}GET /sim/v1/sessions/{id}/optionsPOST /sim/v1/sessions/{id}/selectGET /sim/v1/sessions/{id}/user-inputPOST /sim/v1/sessions/{id}/resetGET /sim/v1/sessions/{id}/evidence
Create a session before a reproducible run:
curl -X POST http://127.0.0.1:8081/sim/v1/sessions \
-H "Content-Type: application/json" \
-d "{\"seed\": 49501, \"attempt_number\": 1}"
Pass the returned session ID in the X-CIT-Sim-Session request header. A chat request without that header receives a newly created session ID in the response header, which is convenient for simple compatibility checks but should not be used for graded multi-request attempts.
Scenario data
The built-in baseline, casual interaction, and later harness-validation scenarios are YAML data packaged separately from the HTTP adapter and engine. Each lab can supply another YAML file without changing the Python implementation:
cit-simulator serve --scenario path/to/scenario.yaml
cit-simulator run --scenario path/to/scenario.yaml
Validate it before use:
cit-simulator validate path/to/scenario.yaml
A branching scenario declares its prompt options on transitions. Each option has a short terminal label and one explicit canonical user prompt. The same transition can declare request expectations such as a required system message, minimum history length, required system-prompt phrases, and required tool names. Responses, next states, timing, and context limits remain scenario data as well.
Evidence and privacy
The server writes one append-only JSON Lines file per session beneath the selected evidence directory. Logs contain structural summaries, counts, identifiers, and hashes rather than raw prompts or credentials. Evidence fields explicitly label the backend as simulator, token counts as approximate, and timing as simulated.
Do not treat simulator TTFT, TPS, or token estimates as measurements of a student's hardware or of a real model.
Specification
The architecture and behavioral authority is TECHNICAL_SPECIFICATION.md. The implementation must not silently weaken its observable contract. Features beyond M1 are future milestones unless the changelog states otherwise.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cit_ai_model_simulator-0.4.1.tar.gz.
File metadata
- Download URL: cit_ai_model_simulator-0.4.1.tar.gz
- Upload date:
- Size: 60.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d9ffe5179a7a4e208856f36a33e1070ad42faeb2a02eab40043759fd9d2ecda
|
|
| MD5 |
bd388a236e36e64c2661c2c16416ecfe
|
|
| BLAKE2b-256 |
4102cfd2b5585334c4251a0b80fd65a122cca4424e9eca73e855eaa2fb180689
|
File details
Details for the file cit_ai_model_simulator-0.4.1-py3-none-any.whl.
File metadata
- Download URL: cit_ai_model_simulator-0.4.1-py3-none-any.whl
- Upload date:
- Size: 36.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68ee9e07531fd322413761e7e143b21965cff8cce81b537025dfa340ddf49c4c
|
|
| MD5 |
449c80562155b053a6ede8107811eb0a
|
|
| BLAKE2b-256 |
68a1db6f7273e4b7d597a0c60f3fdb4f83faa64f7cdb8702992308805f3811ff
|