On this page
Overview
Parses the deterministic packaged Modelfile subset and extracts the SYSTEM prompt.
- Artifact
ModelDefinition.js· esm - Classification
public first party - Availability
Cross-host - Normalization
Complete mutable definition data with coded syntax errors for malformed input.
Import and lifecycle
import * as module from '/arcane/modules/ModelDefinition.js';
parseModelDefinition() is pure. loadModelDefinitionSystemPrompt() makes one complete read-only GET using the fetch implementation's ordinary redirect, credentials, and cache behavior, and never contacts a model service itself.
Application-facing behavior: parseModelDefinition(), loadModelDefinitionSystemPrompt().
Protocol and host implementation
Optional ordinary read-only fetch This detail does not widen the application-facing API or grant authority.
Exports, signatures, parameters, and results
| Binding | Form | Declaration or signature | Parameter syntax |
|---|---|---|---|
parseModelDefinition | function | function parseModelDefinition(source) | source |
loadModelDefinitionSystemPrompt | function | async function loadModelDefinitionSystemPrompt(url,{
fetchImpl=globalThis.fetch
}={}) | url,{
fetchImpl=globalThis.fetch
}={} |
| Callable | Kind | Exact public signature | Parameter syntax |
|---|---|---|---|
parseModelDefinition | exported-function | function parseModelDefinition(source) | source |
loadModelDefinitionSystemPrompt | exported-function | async function loadModelDefinitionSystemPrompt(url,{
fetchImpl=globalThis.fetch
}={}) | url,{
fetchImpl=globalThis.fetch
}={} |
Parameter meanings and results
parseModelDefinition(source) returns mutable {from,system,parameters} for the exact FROM + triple-quoted SYSTEM + unique PARAMETER subset, preserving complete SYSTEM and parameter content. loadModelDefinitionSystemPrompt(url,{fetchImpl?}) resolves the complete SYSTEM prompt string.
Events, side effects, and errors
Source-literal CustomEvent dispatches
No source-literal CustomEvent dispatch is part of this artifact.
Lifecycle and event flow
This artifact has no additional documented lifecycle event flow.
Direct coded failures
MODEL_DEFINITION_INVALIDMODEL_DEFINITION_UNAVAILABLE
Exported Error subclasses
This artifact exports no Error subclass.
Documented failure behavior
- MODEL_DEFINITION_INVALID
- MODEL_DEFINITION_UNAVAILABLE
- Fetch rejection is preserved.
Availability and capabilities
Cross-host. Complete mutable definition data with coded syntax errors for malformed input.
None.
Contract example
import {parseModelDefinition} from '/arcane/modules/ModelDefinition.js';
const definition = parseModelDefinition(
'FROM llama3.2\n\nSYSTEM """\nAnswer briefly.\n"""\n'
);
console.log(definition.system);
Related reference
No direct Core call is claimed for this artifact. Any injected provider or consuming module retains its own documented authority.