English | 日本語
A CLI tool to serve Apple Foundation Models via an OpenAI API-compatible interface.
Exposes Apple Foundation Models as OpenAI API-compatible endpoints with streaming support.
| Endpoint | Method | Description |
|---|---|---|
/v1/models |
GET | List available models |
/v1/models/:model_id |
GET | Get model details |
/v1/chat/completions |
POST | Chat-based text generation |
/v1/completions |
POST | Text completion |
/v1/responses |
POST | Responses API |
temperature- Sampling randomnesstop_p- Top-p samplingmax_tokens/max_output_tokens- Maximum number of tokensseed- Seed for reproducibilitystream- Enable streaming responsesresponse_format- Structured output (json_schema,json_object)
Bearer token authentication is supported. When an API key is configured, all requests must include a valid Authorization: Bearer <api_key> header.
If no API key is configured, all requests are allowed without authentication.
brew tap p1atdev/tap
brew install fameuse- Recommended: macOS Tahoe 26.4 or later
- Required: macOS Tahoe 26.0 or later
- Swift >= 6.2
git clone https://github.com/p1atdev/Fameuse
cd Fameuse
swift build -c releaseBinary path: ./.build/release/fameuse
fameuse serveStarts on 127.0.0.1:8084 by default.
| Option | Short | Default | Description |
|---|---|---|---|
--host |
-h |
127.0.0.1 |
Host address to bind |
--port |
-p |
8084 |
Port to listen on |
--api-key |
API key for authentication |
You can also set the API key via environment variable:
export FAMEUSE_API_KEY="your-secret-key"
fameuse servefameuse serve --host 0.0.0.0 --port 8080 --api-key "your-secret-key"- List models:
curl http://127.0.0.1:8084/v1/models{
"object": "list",
"data": [
{
"id": "apple-foundation-model",
"object": "model",
"owned_by": "apple",
"context_window": 4096
}
]
}- Chat completion:
curl -X POST http://127.0.0.1:8084/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "apple-foundation-model",
"messages": [{"role": "user", "content": "Say hello in one word."}]
}'{
"id": "chatcmpl-...",
"object": "chat.completion",
"model": "apple-foundation-model",
"choices": [
{
"index": 0,
"message": {"role": "assistant", "content": "Hi."},
"finish_reason": "stop"
}
],
"usage": {"prompt_tokens": 47, "completion_tokens": 17, "total_tokens": 64}
}- Structured output (JSON Schema):
curl -X POST http://127.0.0.1:8084/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "apple-foundation-model",
"messages": [{"role": "user", "content": "What is the capital of France?"}],
"response_format": {
"type": "json_schema",
"json_schema": {
"name": "capital_response",
"schema": {
"type": "object",
"properties": {
"capital": {"type": "string"},
"country": {"type": "string"}
},
"required": ["capital", "country"]
},
"strict": true
}
}
}'{
"id": "chatcmpl-...",
"object": "chat.completion",
"model": "apple-foundation-model",
"choices": [
{
"index": 0,
"message": {"role": "assistant", "content": "{\"capital\": \"Paris\", \"country\": \"France\"}"},
"finish_reason": "stop"
}
]
}- Responses API:
curl -X POST http://127.0.0.1:8084/v1/responses \
-H "Content-Type: application/json" \
-d '{
"model": "apple-foundation-model",
"input": "Say hello in one word."
}'{
"id": "resp_...",
"object": "response",
"status": "completed",
"model": "apple-foundation-model",
"output": [
{
"type": "message",
"role": "assistant",
"content": [{"type": "output_text", "text": "Hi."}]
}
]
}You can connect using any OpenAI-compatible SDK by setting the base URL.
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "http://127.0.0.1:8084/v1",
apiKey: "your-api-key", // Required if --api-key is set; otherwise any value works
});- Xcode 26.3 or later
- Swift 6.2 or later
- Bun
git clone https://github.com/p1atdev/Fameuse
cd Fameuse
swift build
bun iSwift tests:
swift testClient tests (requires a running server):
bun testLint and format TypeScript code:
bun run lint
bun run format- mihaelamj/cupertino: Apple documentation lookup
Dual-licensed under MIT or Apache-2.0. See LICENSE-MIT and LICENSE-APACHE for details.