LLM plugin for Apple Foundation Models (Apple Intelligence)
Project description
llm-apple
LLM plugin for Apple Foundation Models (Apple Intelligence)
This plugin exposes Apple's on-device Foundation Models through the llm CLI tool.
Requirements
- macOS 26 or later
- Apple Intelligence enabled
- Python 3.8 or later
- apple-foundation-models installed
Installation
pip install llm # if llm is not already installed
llm install llm-apple
Usage
Basic usage:
llm -m apple "What is the capital of France?"
With streaming:
llm -m apple "Tell me a story" --stream
With options:
llm -m apple "Write a poem" -o temperature 1.5 -o max_tokens 500
With system instructions:
llm -m apple "What is Python?" --system "You are a helpful programming tutor"
Conversations
The plugin supports conversations, maintaining context across multiple prompts:
# Start a conversation
llm -m apple "My name is Alice" --save conversation1
# Continue the conversation
llm -m apple "What is my name?" --continue conversation1
Available Options
temperature(float, 0.0-2.0, default: 1.0): Controls randomness in generation- 0.0 = deterministic
- 2.0 = very random
max_tokens(int, default: 1024): Maximum tokens to generate
System prompts can be provided using llm's built-in --system or -s flag.
Availability
The plugin checks Apple Intelligence availability on startup. If Apple Intelligence is not available, you'll see an error message with details on why.
Common reasons:
- Device not eligible (requires Apple Silicon)
- Apple Intelligence not enabled in Settings
- Model not ready (downloading or initializing)
Examples
Creative writing with higher temperature:
llm -m apple "Write a creative story about a robot" -o temperature 1.8
Factual query with lower temperature:
llm -m apple "Explain quantum computing" -o temperature 0.3
With system prompt for career guidance:
llm -m apple "Should I learn Python or JavaScript?" \
--system "You are a career counselor specializing in tech"
Development
Running Tests
# Run tests
uv run pytest
# Run tests with coverage
uv run pytest --cov=llm_apple --cov-report=html --cov-report=term
The tests use mocks to simulate the Apple Foundation Models API, so they can run on any platform without requiring actual Apple Intelligence hardware.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llm_apple-0.1.1.tar.gz.
File metadata
- Download URL: llm_apple-0.1.1.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb8ef92f9cc57c9b58b9f5635f1dde42cedc801e5d83a200909d15e40044a7be
|
|
| MD5 |
10b56ff18e9779c688924d5b53a9a492
|
|
| BLAKE2b-256 |
24c032af651ae64f6798ac9ff2977ee58631f8593eccbc7b2affdd9aecfbb3c0
|
Provenance
The following attestation bundles were made for llm_apple-0.1.1.tar.gz:
Publisher:
publish-to-pypi.yml on btucker/llm-apple
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_apple-0.1.1.tar.gz -
Subject digest:
fb8ef92f9cc57c9b58b9f5635f1dde42cedc801e5d83a200909d15e40044a7be - Sigstore transparency entry: 677323509
- Sigstore integration time:
-
Permalink:
btucker/llm-apple@378b174126eb9dad2b3d6051c6242a591a2c37aa -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/btucker
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@378b174126eb9dad2b3d6051c6242a591a2c37aa -
Trigger Event:
release
-
Statement type:
File details
Details for the file llm_apple-0.1.1-py3-none-any.whl.
File metadata
- Download URL: llm_apple-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
88167bd0a31f465e02dc9ef50bc9da5f75dfb235893fe72ca382e308e58604fc
|
|
| MD5 |
a8880d6c077a0c036ceae479892bf12f
|
|
| BLAKE2b-256 |
a2a365350a5b18c7f43798d80f0ad276c73780748fc12d6a63e1ea879bc793a2
|
Provenance
The following attestation bundles were made for llm_apple-0.1.1-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on btucker/llm-apple
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_apple-0.1.1-py3-none-any.whl -
Subject digest:
88167bd0a31f465e02dc9ef50bc9da5f75dfb235893fe72ca382e308e58604fc - Sigstore transparency entry: 677323516
- Sigstore integration time:
-
Permalink:
btucker/llm-apple@378b174126eb9dad2b3d6051c6242a591a2c37aa -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/btucker
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@378b174126eb9dad2b3d6051c6242a591a2c37aa -
Trigger Event:
release
-
Statement type: