Skip to main content

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 default mode does not provide a built-in harness. If a selected scenario path requires a harness capability, such as a tool definition, the Model Simulator Response explains that no harness is connected and identifies the unavailable capability. Use cit-simulator run --harness when a student is ready to connect their own implementation.

In harness mode, the harness polls the session's user-input endpoint, adds the selected canonical user message to its own system prompt, history, and tool definitions, and submits the resulting request to /v1/chat/completions. The simulator rejects unexpected packaging with structured, field-level differences. --no-animation disables progressive terminal rendering for accessibility, logging, or automated use.

Week 1 API

Learner-facing endpoints:

  • GET /health
  • GET /v1/health
  • GET /v1/models
  • POST /v1/chat/completions
  • POST /v1/chat/completions/input_tokens

Simulator control endpoints:

  • GET /sim/v1/info
  • POST /sim/v1/sessions
  • GET /sim/v1/sessions/{id}
  • GET /sim/v1/sessions/{id}/options
  • POST /sim/v1/sessions/{id}/select
  • GET /sim/v1/sessions/{id}/user-input
  • POST /sim/v1/sessions/{id}/reset
  • GET /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 and interaction-demo 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

cit_ai_model_simulator-0.4.0.tar.gz (55.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cit_ai_model_simulator-0.4.0-py3-none-any.whl (32.2 kB view details)

Uploaded Python 3

File details

Details for the file cit_ai_model_simulator-0.4.0.tar.gz.

File metadata

  • Download URL: cit_ai_model_simulator-0.4.0.tar.gz
  • Upload date:
  • Size: 55.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.2

File hashes

Hashes for cit_ai_model_simulator-0.4.0.tar.gz
Algorithm Hash digest
SHA256 df1abfafbe335a3611359b69ee4fd29b45b04397b6c6e8761d90a98f71df6945
MD5 9bae0da1d970b2296f8f6145ce969367
BLAKE2b-256 2139dcfacbf3d72f68524bf08784ec640d1d02112f16111cd0cf93167ea50fc9

See more details on using hashes here.

File details

Details for the file cit_ai_model_simulator-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for cit_ai_model_simulator-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6e020a1d87ed2a39701fe3834219c27685d81c186bad6805e6e7ac9bf51426f4
MD5 f9afcff8663cf1e17ce325a12af593b0
BLAKE2b-256 eafc35160ded198eb69201d5948b8a4575c16d41bb5d52810d5cb56567e0155d

See more details on using hashes here.

Release history Release notifications | RSS feed

0.5.0

2 files

0.4.1

2 files

This release

0.4.0 This release

2 files

0.3.1

2 files

0.3.0

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page