Use this skill for technical model construction and editing through the SDK. Keep the scope on SDK mechanics and model validity, not biological plausibility. Initialize the connection with jinko-sdk-setup first.
PREREQUISITE: This skill needs an initialized
jinko-sdkconnection and an SDK satisfying itsmetadata.requires_sdkrange. Run thejinko-sdk-setupskill (../jinko-sdk-setup/SKILL.md) and proceed only once its check passes. A session code can be exchanged only once, so callget_session_codeagain before this skill's own SDK process. If that skill is not found, install it fromnovainsilico/jinko-skills.
Required Workflow
-
If a model was already supplied, prefer editing it over creating a new one. Create one only when needed, in a dedicated folder, with
client.create_empty_model(). -
Retrieve the model, inspect its components, tags, units, solving options, and diagnostics before proposing edits. Inspect the unit-checking mode with
model.get_unit_check(). -
Set the unit-checking mode with
model.set_unit_check("UnitCheckAndConvertAllSpeciesToExtentUnits"). Do not select another mode unless a human explicitly directs it after the consequences are explained. -
Give every directly declared numeric value a unit: numeric parameter formulas, compartment volumes, and species initial conditions. A parameter whose value is derived from an expression may omit its declared unit when the expression determines it. Validate non-trivial units against
references/units_static_info.jsonand diagnostics. -
Attach the built-in platform tags before considering the model complete:
i::vpopfor inputs that vary across virtual patients.i::protocolfor inputs that vary across protocol arms or scenarios, including the dose amount, first dose time, dose interval, and number of doses of a dosing event.- One evidence-backed source tag for each applicable value-bearing input:
s::knowledge,s::arbitrary, ors::to-calibrate. Leave an uncertain input untagged and report it for review. Never assigns::calibratedduring construction; it records an accepted calibration result. outputfor important time-series outputs to plot or calibrate against.
Three of these decide whether the model is usable downstream, so check them across the whole model, not only per component. At least one component must carry
output, or nothing can be plotted, measured, or calibrated against: treat its absence as an error. No component carryingi::protocolmeans the model cannot be given protocol arms, and none carryingi::vpopmeans it cannot vary across virtual patients: report each as a warning, correct only for a model meant to be single-arm and deterministic.python -m jinko.cli.validate_model_readiness --model-sid cm-...runs these three checks by default. -
Attach a traceability link to every value-bearing input tagged
s::knowledge. Prefer, in this order: the Extract that holds the value, the Reference that holds the Extract, then any other project item that produced the value. Use an external DOI or URL only when the project holds no such item, and report every external link for review. Use thejinko-referenceskill to upload a missing source and to create its extracts in a dedicated literature subfolder before you link. -
Optionally attach scientific scoped tags for model navigation and visualization:
granularity::*for biological or spatial scale; tag color#0cd95e.phenomenon::*for the represented physical or biological process; tag color#f87171.module::*for an implemented mechanism or submodel; tag color#66c09c.readout::*for observation level; tag color#da1d1d.
Use confirmed component definitions and source evidence. Preserve existing tags; leave unsupported classifications unassigned. These custom tags are not readiness requirements. Read scientific scoped tags for selection rules and the QSP, PBPK, and PK/PD example catalog. Pass the family color to
model.create_tag(..., color=...); usetag.set_color(...)when aligning an existing declaration. Tag-family colors are separate from graph component-type colors. -
Use high-level SDK methods and
model.components.batch(version="...")for related component changes. The platform tags above already exist; do not recreate them. Create declarations only for other, custom tags. -
Re-fetch the model, require no error diagnostics, and run
simple_solve()for representativeoutputcomponents. For events, verify the expected pre-/post-event change.
To read a method signature, call help() on the object the client returns, for example help(type(model)) or help(model.simple_solve). The SDK has no jinko.model module.
Use scripts/create_minimal_model.py, and the SDK's python -m jinko.cli.tag_model_components and python -m jinko.cli.validate_model_readiness, rather than long ad-hoc snippets. Scripts are dry-run by default and mutate only with --apply.
For transparent ISO 8601 duration conversions, use from jinko.iso8601 import Duration, for example Duration.parse("P1M").to_timedelta(). Solving times accept timedelta or ISO strings: model.set_solving_times(t_max=timedelta(days=28), t_step="P1D", additional_periods=[{"t_max": "P7D", "t_step": timedelta(hours=1)}]).
Reference Routing
- Read
references/model-components.mdfor component batching, tags, events, formulas, and algebraic rules. - Read
references/unit_docs.mdfor unit semantics and conversion behavior. - Read
references/model-validation.mdfor diagnostics and readiness checks. - Read
references/scientific-scoped-tags.mdwhen selecting optional scale, phenomenon, module, or readout tags. It includes a broad, extensible catalog of QSP, PBPK, and PK/PD examples.