Real on-device inference NOW: CoreAI Apple Text node (FoundationModels, macOS 26) - #3
Conversation
…(macOS 26) Apple's SYSTEM language model (FoundationModels) ships with macOS 26 and runs on the Neural Engine TODAY — no coreai-runner / macOS 27 needed (the catalog's .aimodel vision models still require macOS 27's CoreAI framework). - tools/fm-generate.swift: a tiny Swift CLI wrapping FoundationModels (text-only — no image input on macOS 26). Build: tools/build_fm.sh. - comfyui_coreai/nodes/apple_text.py: CoreAIAppleText node shelling out to it, gracefully reporting when Apple Intelligence is off or the model is still downloading (modelNotReady). Category CoreAI/Apple. ruff clean; package imports (10 nodes); tests pass. The compiled binary is gitignored (build locally). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b66503e327
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ) | ||
| try: | ||
| result = subprocess.run( | ||
| [binary, "--prompt", prompt], |
There was a problem hiding this comment.
Pass prompts via stdin instead of argv
When a workflow prompt contains private text, passing it as --prompt exposes the full prompt in the helper process's command-line arguments for the duration of generation, where local process-listing tools can read it. This undermines the node's on-device/private use case; send the prompt over stdin or a private temp file instead.
Useful? React with 👍 / 👎.
Responde "como rodar/testar IA real neste Mac (26.6) sem esperar o macOS 27?".
Descoberta: os
.aimodeldo catálogo (vision) precisam do frameworkCoreAI= macOS 27 (confirmado:error: no such module 'CoreAI'). MAS o FoundationModels (LLM de sistema da Apple) está no macOS 26 e roda na Neural Engine hoje.tools/fm-generate.swift— CLI Swift usando FoundationModels (compila com o SDK 26.5). Text-only (FoundationModels no macOS 26 não tem entrada de imagem).comfyui_coreai/nodes/apple_text.py— nó CoreAIAppleText que chama o CLI; reporta graciosamente quando o Apple Intelligence está off ou o modelo ainda baixa (modelNotReady).tools/build_fm.sh. Binário compilado é gitignored.Escopo honesto: isto é o modelo da Apple (texto), NÃO os modelos vision do catálogo — esses seguem precisando do macOS 27. Mas dá pra rodar IA on-device de verdade agora (ex.: gerar/expandir prompts pro nó de difusão). ruff ✓, 10 nós, testes ✓.