Skip to content

Real on-device inference NOW: CoreAI Apple Text node (FoundationModels, macOS 26) - #3

Merged
kevinqz merged 1 commit into
mainfrom
claude/apple-foundationmodels
Jul 5, 2026
Merged

Real on-device inference NOW: CoreAI Apple Text node (FoundationModels, macOS 26)#3
kevinqz merged 1 commit into
mainfrom
claude/apple-foundationmodels

Conversation

@kevinqz

@kevinqz kevinqz commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator

Responde "como rodar/testar IA real neste Mac (26.6) sem esperar o macOS 27?".

Descoberta: os .aimodel do catálogo (vision) precisam do framework CoreAI = 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).
  • Build: 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 ✓.

…(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>
@kevinqz
kevinqz merged commit 3a75c83 into main Jul 5, 2026
1 check passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant