Skip to content

Asset Downloads

Patronus Ark does not bundle model assets in the Rust crate or Python wheel. Rust-native rule-based scanners run without downloads. Model-backed categories load their manifest assets from the Hugging Face repositories declared in rust/src/assets/specs.rs.

Cache Location

If model_dir is set, that directory is used as the asset root. Otherwise the library uses the platform cache directory and appends patronus_ark:

Platform Typical default cache root
macOS ~/Library/Caches/patronus_ark
Linux ~/.cache/patronus_ark
Windows %LOCALAPPDATA%\patronus_ark

Category assets are stored below that root, for example injection/, sensitive_document/, tool_class/, or dynamic_pii/.

Offline And Missing-Asset Behavior

  • download_files=False disables network downloads even when download_categories is set.
  • Existing cached assets are still used in offline mode.
  • prepare_assets() downloads and verifies configured model assets without initializing model runtimes.
  • asset_readiness() verifies the local cache without downloading or warming models.
  • warmup_from_local_assets() initializes configured runtimes strictly from the local cache and has no download path.
  • warmup() remains the combined compatibility operation: asset preparation followed by offline runtime warmup.
  • If required assets are missing and downloads are disabled for that category, asset preparation fails; native scanners still run where available.
  • Failed downloads for required assets return an error from prepare_assets() and therefore from compatibility warmup().
  • Missing optional assets do not block asset preparation.
  • Optional assets are skipped by default during downloads. Set PATRONUS_DOWNLOAD_OPTIONAL_ASSETS=1 to download optional full ONNX files and sidecar data.
  • Required L3 assets prefer fp16 ONNX files where available.
  • PII is native L1-only and has no model assets.
  • dynamic-pii is L3-only and requires the revision-pinned gliner_small-v2.5-edge bundle below the regular model_dir asset root.
  • L3 ONNX sessions are lazy-loaded on first L3 inference and are evicted after PATRONUS_L3_TTL_SECS seconds of idleness. The default TTL is 300 seconds.
  • Set HF_TOKEN when a model repository requires authenticated or rate-limited Hugging Face access.

L3 Strategy

dedicated loads the configured per-pipeline L3 bundles. multi loads only the revision-pinned patronus-studio/lion-warden-ai-security-classifier classifier bundle at revision 5711c4169442da12f0f4ec20e32f90d940684d20; GLiNER remains separate in both strategies.

The shared ONNX artifact is onnx/int8_int4_embeddings/model.onnx. See docs/unified-multitask-l3-plan.md for its seven-head tensor contract and the request-local worker coalescing contract.

NTDB L2 Packages

NTDB v2 L2 packages are manifest-first and revision-pinned: the runtime downloads manifest.json and every file it references from the immutable Hugging Face commit listed below. Sizes therefore depend on the published package contents at that revision.

For supported Granite/ModernBERT packages, the Security Lib generates a compact tokenizer.kit locally after the verified asset download. Existing official caches are migrated during warmup, while local environment overrides are left untouched. The original tokenizer.json remains the canonical fallback. Generated files are written atomically under a cross-process lock and invalidated by source hash, compact hash, converter version, and format version.

Category Model Repository Revision Source prefix Cache path
Injection wolf-defender-small patronus-studio/wolf-defender-prompt-injection-small eff31df5c97ca127b7b55da255a160f88a625c97 l2 l2_ntdb/injection_current
SensitiveDocument orca-sonar-document-classifier patronus-studio/orca-sonar-document-classifier 64360dd35400f32a11df17e337de4f648d17656d l2 l2_ntdb/sensitive_document_current
ToolClass unified-v3-tool-class patronus-studio/husky-sight-tool-type-classifier e5dac8417697c725edf3c676410a4dd8187bb69d l2 l2_ntdb/tool_class_current
ToolAction unified-v3-tool-action patronus-studio/husky-paw-tool-action-classifier f3ace2a7d0b8d10f6e4d40611521e895e2689e13 l2 l2_ntdb/tool_action_current
ToolTags unified-v3-tool-tags patronus-studio/husky-nose-tool-security-properties-classifier 448a1332cdb3f14a7c3473561b2cfbca0fd17562 l2 l2_ntdb/tool_tags_current
Routing unified-v3-routing patronus-studio/panther-read-intent-classifier 17de8464180c5227802ac44512dd7b039ff45abe l2 l2_ntdb/routing_current
Threat unified-v3-threat patronus-studio/wolf-defender-threat-classifier 54a862f9367fec529c90e8af237083dc11b2cd74 l2 l2_ntdb/threat_current

Download Size Snapshot

Snapshot generated: 2026-07-01T17:36:32+00:00.

The sizes below show required cold-cache downloads for the selected maximum level. Each maximum level includes lower-level required manifest assets for that category. Optional assets are listed in the manifest detail table.

Category L1 required L2 required L3 required Repositories
injection 0 B 0 B unknown patronus-studio/wolf-defender-prompt-injection-small-edge
dlp 0 B 0 B 0 B none
pii 0 B 0 B 0 B none
dynamic-pii 0 B 0 B unknown patronus-studio/gliner_small-v2.5-edge
sensitive_document 0 B 0 B unknown patronus-studio/orca-sonar-document-classifier-edge
tool_class 0 B 0 B 0 B none
tool_action 0 B 0 B 0 B none
tool_tags 0 B 0 B 0 B none
routing 0 B 0 B 0 B none
threat 0 B 0 B 0 B none

Manifest Detail

Category Level Required Source Cache path Size
injection L3 yes patronus-studio/wolf-defender-prompt-injection-small-edge/config.json injection/l3/config.json unknown
injection L3 yes patronus-studio/wolf-defender-prompt-injection-small-edge/tokenizer.json injection/l3/tokenizer.json unknown
injection L3 optional patronus-studio/wolf-defender-prompt-injection-small-edge/tokenizer_config.json injection/l3/tokenizer_config.json unknown
injection L3 yes patronus-studio/wolf-defender-prompt-injection-small-edge/onnx/int8_int4_embeddings/model.onnx injection/l3/onnx/int8_int4_embeddings/model.onnx unknown
sensitive_document L3 yes patronus-studio/orca-sonar-document-classifier-edge/config.json sensitive_document/prompts/config.json unknown
sensitive_document L3 yes patronus-studio/orca-sonar-document-classifier-edge/tokenizer.json sensitive_document/prompts/tokenizer.json unknown
sensitive_document L3 optional patronus-studio/orca-sonar-document-classifier-edge/tokenizer_config.json sensitive_document/prompts/tokenizer_config.json unknown
sensitive_document L3 yes patronus-studio/orca-sonar-document-classifier-edge/onnx/int8_int4_embeddings/model.onnx sensitive_document/prompts/onnx/int8_int4_embeddings/model.onnx unknown
dynamic-pii L3 yes patronus-studio/gliner_small-v2.5-edge/gliner_config.json dynamic_pii/gliner_small_v2_5/gliner_config.json unknown
dynamic-pii L3 yes patronus-studio/gliner_small-v2.5-edge/gliner_onnx_config.json dynamic_pii/gliner_small_v2_5/gliner_onnx_config.json unknown
dynamic-pii L3 yes patronus-studio/gliner_small-v2.5-edge/model_int4_embeddings_int8.onnx dynamic_pii/gliner_small_v2_5/model_int4_embeddings_int8.onnx unknown
dynamic-pii L3 yes patronus-studio/gliner_small-v2.5-edge/quantization_manifest.json dynamic_pii/gliner_small_v2_5/quantization_manifest.json unknown
dynamic-pii L3 yes patronus-studio/gliner_small-v2.5-edge/special_tokens_map.json dynamic_pii/gliner_small_v2_5/special_tokens_map.json unknown
dynamic-pii L3 yes patronus-studio/gliner_small-v2.5-edge/spm.model dynamic_pii/gliner_small_v2_5/spm.model unknown
dynamic-pii L3 yes patronus-studio/gliner_small-v2.5-edge/tokenizer.json dynamic_pii/gliner_small_v2_5/tokenizer.json unknown
dynamic-pii L3 yes patronus-studio/gliner_small-v2.5-edge/tokenizer_config.json dynamic_pii/gliner_small_v2_5/tokenizer_config.json unknown