Implements a Swift gRPC server that exposes Apple's Foundation Models (Apple Intelligence) over the network for LAN access. Features: - Complete: Unary RPC for prompt/response - StreamComplete: Server streaming RPC for token-by-token responses - Health: Check model availability - Optional API key authentication via gRPC metadata - Configurable host/port via CLI args or environment variables Requires macOS 26 (Tahoe) with Apple Intelligence enabled. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
32 lines
1.2 KiB
Swift
32 lines
1.2 KiB
Swift
// swift-tools-version: 6.2
|
|
import PackageDescription
|
|
|
|
let package = Package(
|
|
name: "AppleIntelligenceGRPC",
|
|
platforms: [
|
|
.macOS(.v26)
|
|
],
|
|
dependencies: [
|
|
.package(url: "https://github.com/grpc/grpc-swift.git", from: "2.0.0"),
|
|
.package(url: "https://github.com/grpc/grpc-swift-nio-transport.git", from: "1.0.0"),
|
|
.package(url: "https://github.com/grpc/grpc-swift-protobuf.git", from: "1.0.0"),
|
|
.package(url: "https://github.com/apple/swift-protobuf.git", from: "1.28.0"),
|
|
.package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.3.0"),
|
|
],
|
|
targets: [
|
|
.executableTarget(
|
|
name: "AppleIntelligenceGRPC",
|
|
dependencies: [
|
|
.product(name: "GRPCCore", package: "grpc-swift"),
|
|
.product(name: "GRPCNIOTransportHTTP2", package: "grpc-swift-nio-transport"),
|
|
.product(name: "GRPCProtobuf", package: "grpc-swift-protobuf"),
|
|
.product(name: "SwiftProtobuf", package: "swift-protobuf"),
|
|
.product(name: "ArgumentParser", package: "swift-argument-parser"),
|
|
],
|
|
swiftSettings: [
|
|
.unsafeFlags(["-parse-as-library"])
|
|
]
|
|
),
|
|
]
|
|
)
|