Configuration
Configure models, procedure packs, and runtime behaviour (prototype)
Prototype Documentation: Configuration options described here represent the intended design. Some options may not yet be fully implemented.
UPAS configuration covers model selection, procedure pack sources, and runtime behaviour.
Model Selection
UPAS supports multiple model configurations:
const modelConfig = {
// Primary model for WebGPU runtime
webgpu: {
modelId: "Qwen2.5-0.5B-Instruct-q4f16_1-MLC",
contextLength: 4096,
},
// Fallback model for WASM runtime
wasm: {
modelUrl: "https://huggingface.co/.../model.gguf",
contextLength: 2048,
},
};Model Trade-offs
| Factor | Smaller Models | Larger Models |
|---|---|---|
| Download size | 50–500MB | 1–4GB |
| Inference speed | Faster | Slower |
| Response quality | Basic | Better |
| Memory usage | Lower | Higher |
| Device compatibility | Wider | Narrower |
For field deployments with limited connectivity and diverse devices, smaller models often provide a better trade-off between capability and reliability.
Procedure Packs
Configure which procedure packs to cache:
const packConfig = {
sources: [
{
url: "https://cdn.example.org/packs/emergency-response-v3.2.1.json",
domain: "emergency-response",
locale: "en",
},
{
url: "https://cdn.example.org/packs/wash-v2.1.0.json",
domain: "wash",
locale: "en",
},
],
// Sync behaviour
sync: {
checkInterval: 86400000, // 24 hours
retryOnFailure: true,
preserveRollback: true,
},
};Runtime Settings
Configure inference behaviour:
const runtimeConfig = {
// Inference parameters
inference: {
temperature: 0.7,
topK: 40,
maxTokens: 512,
seed: undefined, // Random by default
},
// UI behaviour
ui: {
showRuntimeBadge: true,
showProvenanceByDefault: true,
enableDegradedMode: true,
},
// Caching
cache: {
version: "upas-cache-v1",
modelCacheFirst: true,
},
};Environment Variables
For builds that support environment variables:
# Model configuration
UPAS_MODEL_ID=Qwen2.5-0.5B-Instruct-q4f16_1-MLC
UPAS_FALLBACK_MODEL_URL=https://huggingface.co/.../model.gguf
# Pack sources
UPAS_PACK_SOURCES=https://cdn.example.org/packs/manifest.json
# Feature flags
UPAS_ENABLE_DEGRADED_MODE=true
UPAS_SHOW_PROVENANCE=trueStorage Management
Configure cache and storage behaviour:
const storageConfig = {
// Cache names
caches: {
app: "upas-app-v1",
models: "upas-models-v1",
packs: "upas-packs-v1",
},
// Cleanup policy
cleanup: {
maxAge: 2592000000, // 30 days
maxSize: 2147483648, // 2GB
},
};Important: Changing cache version strings will invalidate existing caches. Plan cache migrations carefully for deployed devices.
Next Steps
- Guides — Detailed workflows
- Performance — Optimisation strategies