# pflow.xyz > Visual Petri net editor with an embeddable, dependency-free ES module > library for discrete simulation and continuous (ODE) analysis. All modules > are served from this origin with `Access-Control-Allow-Origin: *` — import > them directly from any ad-hoc HTML page, no build step, no npm. ODE > semantics are behaviorally identical to go-pflow (enforced by a parity > test suite). Models are JSON-LD (`@context: https://pflow.xyz/schema`): `places` and `transitions` are objects keyed by id, `arcs` is an array of `{source, target, weight}`. `initial`, `capacity`, and `weight` are vectors (one entry per token color); capacity 0 means unbounded; an explicit 0 weight component means "this color is not involved". ## Docs - [Full guide](https://pflow.xyz/llms-full.txt): model format, copy-paste recipes for solving/plotting/embedding, discrete simulation, related services - [JSON-LD schema](https://pflow.xyz/schema): the @context served as JSON-LD - [Book](https://book.pflow.xyz): Petri nets as a universal abstraction ## Modules - [petri-solver.js](https://pflow.xyz/petri-solver.js): mass-action ODE solver (Tsit5, adaptive) + SVGPlotter interactive charts - [petri-sim.js](https://pflow.xyz/petri-sim.js): discrete firing semantics, pure functions - [petri-colors.js](https://pflow.xyz/petri-colors.js): colored-net unfolding - [petri-view.js](https://pflow.xyz/petri-view.js): the full `` editor web component (with tabbed ODE analysis workbench) - [petri-view.css](https://pflow.xyz/petri-view.css): editor styles, light + dark themes - [petri-learn.js](https://pflow.xyz/petri-learn.js): differentiable fitting for Petri-net ODE models — forward + reverse-mode (adjoint) sensitivities, MSE/relative loss gradients, Adam / Nelder-Mead / coordinate-descent, `fitRates` convenience - [petri-ssa.js](https://pflow.xyz/petri-ssa.js): portable Gillespie SSA (discrete-stochastic simulation) — byte-exact with go-pflow, pflow-rs and pflow-jl via a fixed PRNG (SplitMix64 → xoshiro256**) and a ported log; `simulate(model, {horizon, samples, realizations, seed})` → ensemble mean/stddev/final per place - [petri-sde.js](https://pflow.xyz/petri-sde.js): chemical Langevin SDE — continuous state with the net's own intrinsic firing noise (Euler-Maruyama over the same propensities/stoichiometry `petri-ssa.js` compiles); `simulateSDE(model, {horizon, samples, realizations, seed})` → same shape as `simulate`, plus `diverged`/`reason`/`caveats` when the model gates (read arc, inhibitor, reached capacity — no continuous analogue). Not yet byte-exact cross-language the way SSA is. **Which one for which question**: `petri-solver.js` refuses (rather than silently mismodeling) a net with a read arc, inhibitor, reached capacity or guard — use `petri-ssa.js` (or `petri-sde.js`, same refusal) for those, or whenever token counts are small enough that variance is the answer, not noise around it; `petri-sde.js` sits between the two — noise, but no individual discrete events. Above arc weight 1 the three compute genuinely different rate laws, not a continuous vs. discrete version of the same one. Full rules: `docs/engine-selection.md` (vendored from go-pflow, `scripts/docs-sync.sh check`). ## Services - [Sim MCP server](https://sim.pflow.xyz/mcp): JSON-RPC tools to build, run and check models (sim_create_model, sim_scenario, sim_invariants, sim_reach, sim_verify, …) - [Server-side SVG rendering](https://pflow.xyz/api/svg): POST a model, get an SVG - [sim.pflow.xyz](https://sim.pflow.xyz/mcp): describe a process, get a model you can run and check — seeded scenarios, invariant and reachability proofs, calibration, and diagnostics that rank every knob by measured effect on the objective - [pflow-native](https://github.com/pflow-xyz/pflow-native): native desktop editor and simulator for the same models, with a CLI and an MCP server ## Optional - CDN mirrors for strict-CSP hosts that block pflow.xyz — pin a tag, `@main` is cached ~12h by jsDelivr: - [jsDelivr](https://cdn.jsdelivr.net/gh/pflow-xyz/pflow-xyz@v1.27.0/public/petri-solver.js) - npm-backed (`@pflow-xyz/pflow-xyz` on npm since 2026-08-01): `https://esm.sh/@pflow-xyz/pflow-xyz@1.27.0/petri-solver.js` or `https://unpkg.com/@pflow-xyz/pflow-xyz@1.27.0/petri-solver.js` - cdnjs (pending acceptance — needs 800+ npm downloads/month or 200 GitHub stars; placeholder, 404s until then): `https://cdnjs.cloudflare.com/ajax/libs/pflow-xyz//petri-solver.js` - **claude.ai artifacts cannot load these modules today.** Their CSP allows scripts only from `cdnjs.cloudflare.com`; pflow.xyz, jsDelivr, esm.sh, and unpkg are all refused (`Failed to fetch dynamically imported module`). Do not emit an import-with-fallback loader for artifacts — host the page elsewhere instead. Also note `file://` pages can't load ES modules at all; open local pages via `python3 -m http.server`.