← 开源
gety-ai

apple-on-device-openai

OpenAI-compatible API server for Apple on-device models

InfrastructureGatewaySwift
在 GitHub 打开
增长势头
+024 小时新增 Star0.0%
890
Star
66
Fork
+0
本周
5
贡献者
创建于 2025-06-15 · 更新于 2026-10-13 · 今日第 12868 名
主要开发者
channingkeiko233RayKitajima

gety-ai/apple-on-device-openai 排名第 12,868,有 890 个星标。

同类别比较

gety-ai/apple-on-device-openai 排名第 12,868,此处有 8 个同类条目;Meterless/genai-agentos 排名第 12,864。

同类别比较
名称排名指标
kendryte/nncase12,815
语言:
C#
星标数:
897
分叉数:
211
简介:
Open deep learning compiler stack for Kendryte AI accelerators ✨
lanterndata/lantern12,835
语言:
Rust
星标数:
895
分叉数:
67
简介:
PostgreSQL vector database extension for building AI applications
SoftInstigate/restheart12,855
语言:
Java
星标数:
892
分叉数:
177
简介:
A backend for web, mobile, AI and IoT apps. Built on MongoDB
Meterless/genai-agentos12,864
语言:
Python
星标数:
890
分叉数:
282
简介:
GenAI infrastructure
spiritbuun/buun-llama-cpp12,887
语言:
C++
星标数:
888
分叉数:
94
简介:
Experimental llama.cpp fork for inference research and development
gaboolic/cloudflare-reverse-fast12,905
语言:
JavaScript
星标数:
885
分叉数:
326
简介:
cloudflare加速openai等接口
UniversalRobots/Universal_Robots_ROS_Driver12,912
语言:
C++
星标数:
884
分叉数:
423
简介:
Universal Robots ROS driver supporting CB3 and e-Series
jacobgil/pytorch-pruning12,916
语言:
Python
星标数:
884
分叉数:
202
简介:
PyTorch Implementation of [1611.06440] Pruning Convolutional Neural Networks for Resource Efficient Inference
关键参数与规格
关键参数与规格
参数值
语言Swift
类别Infrastructure
子类别Gateway
关键词LocalAI
星标数890
分叉数66
贡献者5
创建日期2025-06-15
更新日期2026-10-13
1 天星标数0
7 天星标数0
排名12,868
上次排名12,766
排名变化-102
7 天星标排名13,639
上次 7 天星标排名13,655
7 天星标排名变化16
总星标排名12,202
上次总星标排名12,185
总星标排名变化-17
README 摘录

Apple On-Device OpenAI API A SwiftUI application that creates an OpenAI-compatible API server using Apple's on-device Foundation Models. This allows you to use Apple Intelligence models locally through familiar OpenAI API endpoints. Screenshot Use it in any OpenAI compatible app: Features **OpenAI Compatible API**: Drop-in replacement for OpenAI API with chat completions endpoint **Streaming Support**: Real-time streaming responses compatible with OpenAI's streaming format **On-Device Processing**: Uses Apple's Foundation Models for completely local AI processing

**Model Availability Check**: Automatically checks Apple Intelligence availability on startup **🚧 Tool Using (WIP)**: Function calling capabilities for extended AI functionality Requirements **macOS**: 26 beta 2 **Apple Intelligence**: Must be enabled in Settings > Apple Intelligence & Siri **Xcode**: 26 beta 2 (for building) Installation Option 1: Download Pre-built App (Recommended) 1. Extract and launch the app Option 2: Build from Source 1. Build and run the project in Xcode Why a GUI App Instead of Command Line? This project is implemented

as a GUI application rather than a command-line tool due to **Apple's rate limiting policies** for Foundation Models: "An app that has UI and runs in the foreground doesn't have a rate limit when using the models; a macOS command line tool, which doesn't have UI, does. If you experience rate limiting, please restart the server. **⚠️ 重要提醒**: 由于苹果 FoundationModels 当前的限制,您仍然可能遇到速率

限制。 Configure server settings (default: ) 3. Server will be available at the configured address Available Endpoints Once the server is running, you can access these OpenAI-compatible endpoints: - Health check - Model availability and status - List available models - Chat completions (streaming and non-streaming) Example Usage Using curl: Using OpenAI Python client: Testing You can use the included test script to verify the server is working correctly and see example usage patterns: The test script will: ✅ Check server health and

connectivity ✅ Verify model availability and status ✅ Test OpenAI SDK compatibility ✅ Run multi-turn conversations ✅ Test multilingual support (Chinese) ✅ Demonstrate streaming functionality Make sure the server is running before executing the test script. The script provides comprehensive examples of how to interact with the API using both direct HTTP requests and the OpenAI Python SDK. API Compatibility This server implements the OpenAI Chat Completions API with the following supported parameters: - Model identifier (use "apple-on-device") - Array of conversation messages - Sampling

temperature (0. 0) - Maximum tokens in response - Enable streaming responses Development Notes 🤖 This project was mainly "vibe coded" using Cursor + Claude Sonnet 4 & ChatGPT o3. License This project is licensed under the MIT License - see the LICENSE file for details. References Apple Foundation Models Documentation OpenAI API Documentation

常见问题

记录了多少星标和分叉?

gety-ai/apple-on-device-openai 有 890 个星标和 66 个分叉。

仓库排名是多少?

gety-ai/apple-on-device-openai 排名第 12,868。

记录的语言和类别是什么?

gety-ai/apple-on-device-openai 有 890 个星标,语言为 Swift,类别为 Infrastructure。

哪个仓库排名最接近?

gety-ai/apple-on-device-openai 与 Meterless/genai-agentos 比较,后者排名第 12,864,有 890 个星标。

README

Apple On-Device OpenAI API

A SwiftUI application that creates an OpenAI-compatible API server using Apple's on-device Foundation Models. This allows you to use Apple Intelligence models locally through familiar OpenAI API endpoints.

Screenshot

Use it in any OpenAI compatible app:

Features

  • OpenAI Compatible API: Drop-in replacement for OpenAI API with chat completions endpoint
  • Streaming Support: Real-time streaming responses compatible with OpenAI's streaming format
  • On-Device Processing: Uses Apple's Foundation Models for completely local AI processing
  • Model Availability Check: Automatically checks Apple Intelligence availability on startup
  • 🚧 Tool Using (WIP): Function calling capabilities for extended AI functionality

Requirements

  • macOS: 26 beta 2
  • Apple Intelligence: Must be enabled in Settings > Apple Intelligence & Siri
  • Xcode: 26 beta 2 (for building)

Installation

Option 1: Download Pre-built App (Recommended)

  1. Go to the Releases page
  2. Download the latest .zip file
  3. Extract and launch the app

Option 2: Build from Source

  1. Clone the repository:
git clone https://github.com/gety-ai/apple-on-device-openai.git
cd apple-on-device-openai
  1. Open the project in Xcode:
open AppleOnDeviceOpenAI.xcodeproj
  1. Build and run the project in Xcode

Why a GUI App Instead of Command Line?

This project is implemented as a GUI application rather than a command-line tool due to Apple's rate limiting policies for Foundation Models:

"An app that has UI and runs in the foreground doesn't have a rate limit when using the models; a macOS command line tool, which doesn't have UI, does."

— Apple DTS Engineer (Source)

⚠️ Important Note: You may still encounter rate limits due to current limitations in Apple FoundationModels. If you experience rate limiting, please restart the server.

⚠️ 重要提醒: 由于苹果 FoundationModels 当前的限制,您仍然可能遇到速率限制。如果遇到这种情况,请重启服务器。

Usage

Starting the Server

  1. Launch the app
  2. Configure server settings (default: 127.0.0.1:11535)
  3. Click "Start Server"
  4. Server will be available at the configured address

Available Endpoints

Once the server is running, you can access these OpenAI-compatible endpoints:

  • GET /health - Health check
  • GET /status - Model availability and status
  • GET /v1/models - List available models
  • POST /v1/chat/completions - Chat completions (streaming and non-streaming)

Example Usage

Using curl:

curl -X POST http://127.0.0.1:11535/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "apple-on-device",
    "messages": [
      {"role": "user", "content": "Hello, how are you?"}
    ],
    "temperature": 0.7,
    "stream": false
  }'

Using OpenAI Python client:

from openai import OpenAI

# Point to your local server
client = OpenAI(
    base_url="http://127.0.0.1:11535/v1",
    api_key="not-needed"  # API key not required for local server
)

response = client.chat.completions.create(
    model="apple-on-device",
    messages=[
        {"role": "user", "content": "Hello, how are you?"}
    ],
    temperature=0.7,
    stream=True  # Enable streaming
)

for chunk in response:
    if chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="")

Testing

You can use the included test script to verify the server is working correctly and see example usage patterns:

python3 test_server.py

The test script will:

  • ✅ Check server health and connectivity
  • ✅ Verify model availability and status
  • ✅ Test OpenAI SDK compatibility
  • ✅ Run multi-turn conversations
  • ✅ Test multilingual support (Chinese)
  • ✅ Demonstrate streaming functionality

Make sure the server is running before executing the test script. The script provides comprehensive examples of how to interact with the API using both direct HTTP requests and the OpenAI Python SDK.

API Compatibility

This server implements the OpenAI Chat Completions API with the following supported parameters:

  • model - Model identifier (use "apple-on-device")
  • messages - Array of conversation messages
  • temperature - Sampling temperature (0.0 to 2.0)
  • max_tokens - Maximum tokens in response
  • stream - Enable streaming responses

Development Notes

🤖 This project was mainly "vibe coded" using Cursor + Claude Sonnet 4 & ChatGPT o3.

License

This project is licensed under the MIT License - see the LICENSE file for details.

References

排名相邻
同类项目