Project Metadata
Relevant source files
The following files were used as context for generating this wiki page:
Introduction
Project Metadata within the ONNX-Station repository encompasses the static and dynamic configuration data required to orchestrate the "Optimum Exporter" workbench. This metadata defines the application's identity, its dependency tree, environment configurations, and the structural parameters used to transform Hugging Face models into optimized ONNX artifacts.
The scope of this metadata ranges from high-level project definitions (such as name and capabilities) to granular technical specifications (such as ONNX opset versions, execution providers, and modality-specific tensor shapes). These definitions ensure that the workbench can reliably interface with external libraries like onnxruntime-web and optimum-cli.
Sources: metadata.json:1-10, package.json:1-15
Core Application Metadata
The root-level metadata defines the foundational identity and functional capabilities of the project. This includes basic descriptors used by deployment platforms and development environments.
Application Definition
The primary application metadata is stored in metadata.json, identifying the project as "Optimum Exporter," a local-first workbench designed to configure and orchestrate model exports.
| Field | Value | Description |
|---|---|---|
name | Optimum Exporter | The formal name of the application. |
description | Local-first workbench... | Explains the primary purpose of the system. |
majorCapabilities | MAJOR_CAPABILITY_SERVER_SIDE_GEMINI_API | Identifies support for server-side AI integration. |
Sources: metadata.json:1-9
Development and Build Metadata
The project utilizes vite as its build tool and npm for dependency management. The package.json file serves as the source of truth for the project version, scripts, and both runtime and development dependencies.
The build system specifically includes aliases for the root directory and conditional Hot Module Replacement (HMR) settings to optimize the developer experience within specific environments like AI Studio.
Sources: package.json:7-35, vite.config.ts:7-21
Export Configuration Metadata
A significant portion of the project's metadata is dedicated to the ExportConfig structure, which defines how models are processed. This metadata is used to generate the command strings for the optimum-cli.
Configuration Data Structure
The ExportConfig interface provides a comprehensive map of all parameters required for a successful ONNX export.
| Parameter | Type | Default/Examples |
|---|---|---|
modelSourceType | 'hub' | 'local' | 'hub' |
opset | number | 14 (standard), 17 (recommended) |
device | 'cpu' | 'cuda' | 'cpu' |
dtype | 'fp32' | 'fp16' | 'bf16' | 'fp32' |
optimize | 'none' | 'O1' | 'O2' | 'O3' | 'O4' | 'none' |
framework | 'pt' | 'tf' | 'pt' |
Sources: src/types.ts:31-61, src/WorkbenchContext.tsx:75-102
System Presets
The workbench includes metadata for standard "Optimization Profiles" (Presets). These presets represent pre-validated configurations for specific hardware targets.
- WebGPU fp16 Target: Optimized for browser-based GPU acceleration using O3 optimization and Opset 17.
- CPU fp32 Portable: Designed for maximum compatibility across devices using Opset 14.
- CUDA bf16 Heavy: Targeted at high-performance discrete GPUs using aggressive O4 optimizations.
Sources: src/WorkbenchContext.tsx:5-39
Domain-Specific Metadata
The application categorizes model tasks and structural information based on the input modality. This metadata ensures that the user interface and the underlying CLI generator use correct parameters for the selected model type.
Modality and Task Mapping
The system maps three primary modalities—audio, text, and vision—to specific Optimum tasks.
Sources: src/types.ts:3-29
Model Architecture Metadata
Metadata in src/utils/modelInfo.ts is used to simulate or analyze model graphs. It contains logic to identify model families (e.g., Whisper, LLaMA, BERT, ViT) and map them to expected layer counts and operator distributions. For instance:
- LLaMA/Qwen: Associated with 32 layers.
- Whisper Large: Associated with 24 layers (encoder/decoder stack).
- BERT Base: Associated with 12 layers.
Sources: src/utils/modelInfo.ts:11-38
Summary
Metadata in ONNX-Station functions as the central nervous system of the workbench. It integrates static project definitions from package.json and metadata.json with dynamic architectural and configuration data found in src/types.ts and src/WorkbenchContext.tsx. This structured information allows the application to provide a high-fidelity environment for model optimization, ensuring that the generated ONNX artifacts are tailored to specific hardware and performance requirements.