Description
The ARM64/CoreML segfault mitigation in mempalace/__init__.py line 19 sets an environment variable that ONNX Runtime does not read, making the fix completely non-functional.
os.environ.setdefault("ORT_DISABLE_COREML", "1")
Root Cause
ORT_DISABLE_COREML is not a recognized ONNX Runtime environment variable. ONNX Runtime does not provide a global env var to disable individual execution providers.
This means:
Verification
- The ONNX Runtime CoreML documentation lists no such environment variable
- Searching the ONNX Runtime source code for "ORT_DISABLE_COREML" returns zero results
- Provider selection is controlled at the session level via
InferenceSession(model, providers=[...]), not via environment variables
How to actually disable CoreML
The correct approach for ChromaDB's default embedding function:
from chromadb.utils.embedding_functions import ONNXMiniLM_L6_V2
ef = ONNXMiniLM_L6_V2(preferred_providers=["CPUExecutionProvider"])
Or when creating the ONNX session directly:
import onnxruntime as ort
session = ort.InferenceSession(model_path, providers=["CPUExecutionProvider"])
Impact
Suggested Fix
Replace the no-op env var with an actual provider override:
# In mcp_server.py / miner.py wherever ChromaDB clients are created:
import platform
if platform.machine() in ("arm64", "aarch64") and platform.system() == "Darwin":
ef = ONNXMiniLM_L6_V2(preferred_providers=["CPUExecutionProvider"])
collection = client.get_or_create_collection("mempalace_drawers", embedding_function=ef)
Remove the no-op from __init__.py:
-os.environ.setdefault("ORT_DISABLE_COREML", "1")
Environment
Description
The ARM64/CoreML segfault mitigation in
mempalace/__init__.pyline 19 sets an environment variable that ONNX Runtime does not read, making the fix completely non-functional.Root Cause
ORT_DISABLE_COREMLis not a recognized ONNX Runtime environment variable. ONNX Runtime does not provide a global env var to disable individual execution providers.This means:
Verification
InferenceSession(model, providers=[...]), not via environment variablesHow to actually disable CoreML
The correct approach for ChromaDB's default embedding function:
Or when creating the ONNX session directly:
Impact
__init__.pyprovides false confidenceSuggested Fix
Replace the no-op env var with an actual provider override:
Remove the no-op from
__init__.py:-os.environ.setdefault("ORT_DISABLE_COREML", "1")Environment
__init__.pyline 19