CoreMLProvider#
- class openstef_foundation_models.inference.CoreMLProvider(**data: Any) None[source]#
Bases:
BaseConfigThe CoreML execution provider (Apple, GPU/Neural Engine).
ModelFormat=MLProgramis required for modern CoreML: the legacyNeuralNetworkformat fragments the graph and silently falls back to CPU for many ops.- Parameters:
data (
Any)
- model_format: Literal['MLProgram', 'NeuralNetwork']#
CoreML model format. MLProgram is required for modern op coverage.
- compute_units: Literal['CPUOnly', 'CPUAndGPU', 'CPUAndNeuralEngine', 'ALL']#
Which compute units CoreML may dispatch to. Prefer ‘CPUAndGPU’ for large transformer graphs: allowing the Neural Engine (‘ALL’/’CPUAndNeuralEngine’) can make CoreML’s ahead-of-time compile run for many minutes for no inference win.
- cache_dir: Path | None#
Directory for CoreML’s compiled-model cache (ORT ‘ModelCacheDirectory’). CoreML compiles the graph ahead of time on session build, which is slow; caching it cuts a warm rebuild from tens of seconds to a few. The cache is ORT-version/OS/hardware-specific — a local speedup, not a portable artifact. Requires ‘MLProgram’ format.