● DOCS · v0.1 LAST UPDATED · 2026-04

Docs, parameters,
references.

Everything you need to reason about what EpiChat will and won't do — architecture, parameters, disease defaults, and the seven-phase data roadmap.

Architecture

EpiChat is a five-layer pipeline. The LLM handles language; templates handle the simulation. Free-form code is never executed.

User NL query
     │
     ▼
Layer 1  LLM Parameter Parser     (Claude API + extraction prompt)
     │   Structured JSON (SimParams)
     ▼
Layer 2  Data-informed resolver   (country data — proposed)
     │   Calibrated params
     ▼
Layer 3  Code generator           (Jinja2 → Starsim Python)
     │   Python script
     ▼
Layer 4  Execution engine         (subprocess sandbox, 90s timeout)
     │   Stats JSON + plot file
     ▼
Layer 5  Results narrator         (Claude API + narration prompt)
     │   Plain-language summary
     ▼
User: epidemic curve + interpretation

Disease models

Six compartmental models, each specified directly or inferred from a disease name.

ModelCompartmentsUse caseRequired extras
SIRS → I → RStandard acute (flu, COVID acute)
SEIRS → E → I → RLatent period (measles, SARS)dur_exp
SISS → I → SNo lasting immunity (gonorrhea)
SIRSS → I → R → SWaning immunity (COVID endemic)dur_immune
SEIRSS → E → I → R → SLatent + waning (COVID full)dur_exp, dur_immune
SEIARS → E → I|A → RAsymptomatic transmission (flu, COVID)dur_exp, p_asymp, rel_trans_asymp

Built-in disease defaults

Name a disease without full parameters and EpiChat fills these in.

DiseaseModeldur_infdur_expn_contactsp_deathNotes
Generic SIRSIR10 d40.0R₀ = 2.5
COVID (acute)SIR8 d60.01
COVID (endemic)SIRS8 d60.005immune = 180 d
COVID (full)SEIRS8 d5 d60.005immune = 180 d
InfluenzaSIR5 d60.001
MeaslesSEIR8 d12 d100.001R₀ ≈ 15
SARS-likeSEIR10 d5 d50.05
EbolaSIR10 d30.5
GonorrheaSIS90 d20.0R₀ ≈ 2

Parameters

Every parameter is validated by a Pydantic schema before the template layer sees it.

ParameterTypeDefaultDescription
disease_typestringsirsir · seir · sis · sirs · seirs · seiar
n_agentsint10,000Population size · 10 → 1,000,000
betafloatcomputedβ = R₀ × 365 / (n_contacts × dur_inf)
init_prevfloat0.01Seed fraction infected
dur_inffloat10.0Infectious period (days)
dur_expfloat?nullLatent period · required for SEIR/SEIRS/SEIAR
dur_immunefloat?nullImmunity days before waning · SIRS/SEIRS
p_deathfloat0.0Infection fatality rate
p_asympfloat0.3Asymptomatic fraction · SEIAR only
sim_dur_yearsfloat1.0Simulation horizon
network_typestringrandomrandom · age_structured
n_contactsint4Avg daily contacts
network_betafloat1.0Transmission multiplier per contact

Interventions

Up to three intervention types can combine in a single simulation.

Vaccine

Removes a fraction of agents from the susceptible pool. start_day=0 = pre-existing immunity; >0 = ongoing campaign starting that day.

Treatment

Reduces infectious duration or mortality for a fraction of infected agents. Optional daily capacity cap.

Seasonality

Modulates transmission rate sinusoidally over the year — scale is variation strength, shift is phase (0.0 = winter peak, 0.5 = summer peak).

NL query tips

EpiChat's parser understands a wide range of phrasing. A few useful patterns:

You sayEpiChat does
"R0 = 2.5"Converts to β via R₀ × 365 / (n_contacts × dur_inf)
"COVID", "flu", "measles"Applies built-in disease defaults
"80% vaccinated"Vaccine intervention, start_day=0
"campaign starting month 3"Vaccine intervention, start_day=90
"winter peak" / "seasonal"Seasonality · scale=0.3, shift=0.0
"endemic" / "long-run"Enables demographics
"age-structured" / "school-age"network_type=age_structured
"masks" / "50% mask uptake"network_beta ≈ 0.75
"seed 42" / "reproducible"rand_seed=42

Roadmap

Seven phases in priority order. Complexity is implementation effort; impact is how much it moves the scientific needle.

#PhaseDataComplexityImpact
1Country demographicsUN WPP · World Bank · WHO GHOLow–MediumHigh
2Country contact matricesPrem et al. 2021 · SOCRATES · CoMixMediumHigh
3Age-specific severityO'Driscoll 2021 · CDC COVID-NET · FluViewMediumHigh
4HouseholdNetDHS · IPUMS · UN household data · ACSHighMedium
5Calibration vs surveillanceOWID · CDC Tracker · WHO FluNet · TychoHighVery High
6STI networksDHS sexual module · NATSAL · CDC NHBSVery HighMedium
7Geospatial metapopulationWorldPop · OAG · OSMVery HighHigh

Risks · mitigations

RiskMitigation
Invalid Starsim codeTemplate-based generation — no free-form LLM code
Parameter hallucinationPydantic validation + plausibility checks
Execution failure3-attempt recovery loop with LLM re-parameterization
Timeout90-second subprocess limit
API instabilityStarsim version pinned in requirements.txt