Skip to content

Add an Apple Intelligence connection through fm serve - #208

Open
Will Walker (willswire) wants to merge 2 commits into
microsoft:mainfrom
willswire:feat/apple-fm-connection
Open

Will Walker (willswire) wants to merge 2 commits into
microsoft:mainfrom
willswire:feat/apple-fm-connection

Conversation

@willswire

Copy link
Copy Markdown

Linked issue

Fixes #206. Works without #207, but until #207 is merged, an overflow on PCC is retried (and counts against the
daily quota); docs/apple-fm.md describes the behaviour with #207.

What changed (Before / After)

  • Before: reaching Apple's model on Private Cloud Compute meant knowing that fm serve speaks Chat Completions,
    its address, the model name pcc and its window, and no reasoning effort was sent to it.
  • After: on macOS, Settings → Models → Add a connection offers Apple Intelligence, a keyless openai-chat
    connection to 127.0.0.1:1976/v1 with model pcc and a 32,768-token window. Reasoning effort is sent for pcc
    at low/medium/high (fm rejects other levels with HTTP 400). The tile shows Apple's logo from the bundled LobeHub
    icon set; scripts/model-icons.py now asks for it. docs/apple-fm.md explains the setup and the one condition:
    PCC answers only if fm serve was started from Terminal.app. The README provider table links to it.

No new provider, dependency or sign-in; fm serve takes tools and returns tool_calls, so the model sees the
same prompt and bash tool as with any Chat Completions service.

Visual proof (UI / TUI / Web / Desktop / export changes)

Settings → Models → Add a connection, on macOS.

Before:

Screenshot 2026-12-06 at 09 14 56

After:

Screenshot 2026-12-06 at 09 19 43

How you verified it

  • tests/test_connections.py: the preset is offered on macOS and not elsewhere, saves as a keyless connection, and
    new sessions get pcc with a 32,768 window.
  • tests/test_provider_conformance.py: the effort mapping for every level, and none for the on-device system
    model.
  • tests/test_model_icons.py: Apple's logo is bundled for the tile; no other name resolves to a different icon.
  • uv run pyflakes src tests .github/scripts; the tests above pass; tests/test_web_connection_checks.py and
    tests/test_web_model_settings.py pass with a real browser.
  • Manually on macOS 27.2.1 (26B131) with fm serve started from Terminal.app: freehand -p "Use bash to run 'echo hi', then tell me exactly what it printed." --provider openai-chat --api-base http://127.0.0.1:1976/v1 --model pcc --effort low ran echo hi and answered correctly. The window (32,768) and the error shapes in the
    docs were measured against the same server.

PCC is a mid-size model with a 32K window and a daily quota; the docs mark this experimental and make no benchmark
claims.

AI disclosure & checklist

  • AI disclosure: AI-assisted (personally tested and verified)
  • uv run pyflakes src tests .github/scripts prints nothing and relevant tests pass locally (full suite runs in CI)
  • Left CHANGELOG.md untouched (maintainers update it at release time)
  • No change to what the model sees (prompt, tool descriptions, status line, notes), or benchmark evidence attached
  • src/freehand/runtime/ still uses only the standard library and imports on Python 3.9

🤖 Generated with Claude Code

…rve`

macOS 27's `fm serve` is a local Chat Completions server with native tool
calls, so PCC needs no new provider: a macOS-only "Apple Intelligence
(fm serve)" connection preset points openai-chat at 127.0.0.1:1976 with
model pcc and its measured 32,768-token window. reasoning_effort is sent
for pcc at low/medium/high only; fm rejects other levels with HTTP 400.

docs/apple-fm.md records setup and the spike findings, including that
PCC answers only when fm serve was started from Terminal.app.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The tile showed a bare "A": no icon was bundled for it. Apple's mark
comes from the same LobeHub set (1.107.0) as the others, asked for
through SERVICE_WORDS so a regeneration keeps it; no other name
resolves differently. The preset is now named plainly "Apple
Intelligence".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Dec 6, 2026

Copy link
Copy Markdown

Thanks for the pull request! A few friendly reminders based on the files changed:

  • Model-facing / runtime core: This PR touches benchmark-sensitive or Python 3.9 stdlib runtime files (src/freehand/runtime/providers.py). Please make sure Python 3.9 stdlib imports still pass and attach benchmark evidence if model-visible behaviour changed.

(This comment updates automatically when you edit the PR description or push new commits.)

@willswire Will Walker (willswire) changed the title Feat/apple fm connection Add an Apple Intelligence connection through fm serve Dec 6, 2026

This branch has not been deployed

No deployments
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.

Connect to Apple Intelligence on Private Cloud Compute through fm serve (macOS 27)

1 participant