Add Private Cloud Compute CLI and development signing - #301
Draft
scouzi1966 wants to merge 1 commit into
Draft
scouzi1966 wants to merge 1 commit into
scouzi1966 wants to merge 1 commit into
Conversation
Reviewer's GuideIntroduces an explicitly selected native Private Cloud Compute integration with macOS 27 gating, CLI and HTTP access, and a local development packager that validates provisioning authorization and signs/verifies the complete app bundle without adding credentials or provider dependencies. Sequence diagram for a PCC CLI requestsequenceDiagram
participant User
participant CLI as afm pcc
participant Runtime as PCCConfiguration
participant Status as PCCStatus
participant Provider as AFMKit PCC provider
participant PCC as Apple PCC
User->>CLI: pcc respond or serve
CLI->>Runtime: requireSupportedRuntime()
alt macOS below 27
Runtime-->>CLI: RuntimeError.unsupported
CLI-->>User: Actionable error, no model created
else macOS 27 or later
CLI->>Status: current()
alt unavailable or missing entitlement
Status-->>CLI: unavailable status
CLI-->>User: ValidationError
else available
CLI->>Runtime: makeEngine() or makeModel()
Runtime->>Provider: makeModel(privateCloudComputeModelID)
Provider->>PCC: Generate response
PCC-->>Provider: Stream or complete response
Provider-->>CLI: Response
CLI-->>User: Text or HTTP response
end
end
Flow diagram for PCC development app packagingflowchart TD
Start["Built AFM executable"] --> Profile["Decode provisioning profile"]
Profile --> Validate["Validate AFM App ID, PCC entitlement, expiry, device UDID"]
Validate --> Identity["Select matching Apple Development identity"]
Identity --> Resources["Copy executable and runtime resources"]
Resources --> Nested["Sign nested Mach-O code"]
Nested --> App["Sign AFM.app with validated entitlements"]
App --> Verify["codesign verify and entitlement comparison"]
Verify --> Bundle["Signed local development AFM.app"]
Flow diagram for PCC HTTP error classificationflowchart LR
Request["Chat completion request"] --> Provider["AFMKit PCC provider"]
Provider --> Result{"Provider result"}
Result --> Invalid["Invalid request or unsupported capability"]
Result --> Unavailable["Provider unavailable or loading failed"]
Result --> Generation["Generation failed"]
Result --> InvalidResponse["HTTP 400 invalid_request_error"]
Result --> UnavailableResponse["HTTP 503 provider_unavailable"]
Result --> GenerationResponse["HTTP 502 provider_error"]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
afm pcc status,respond,chat, andserveusing the native PCC provider already present in the pinned AFMKit version. PCC is explicitly selected, never falls back to on-device inference, and exits with an actionable message on macOS 26 before constructing a PCC model.Add a development app packager that validates the explicit AFM App ID, PCC entitlement, profile expiry, Apple Development certificate, and the Mac’s provisioning UDID. It packages runtime resources, signs nested code and the app, and verifies the resulting signature. No provider implementation, dependency pin, certificate, or provisioning profile is added to the repository.
The HTTP route identifies the Apple model and distinguishes provider availability/generation failures from invalid requests. The pinned provider currently erases native quota error types, so this PR preserves generic 503/502 failures rather than guessing HTTP 429 from localized text.
Validation:
Scripts/swiftpm-reliable.shwith its automatic native-driver retry. Final edits made afterward have not been rebuilt.com.scouzi1966.afmand its matching signing identity; a profile for Vesta cannot authorize AFM.Draft pending final build/XCTest/CLI validation and the signed PCC smoke test. Setup, commands, limits, and exact verification commands are in
docs/private-cloud-compute.md.Summary by Sourcery
Add explicitly provisioned Private Cloud Compute support to the CLI, HTTP server, and local development workflow.
New Features:
afm pcccommands for status checks, one-shot responses, terminal chat, and an OpenAI-compatible HTTP server using Apple’s native Private Cloud Compute provider.Bug Fixes:
Enhancements:
Build:
Documentation:
Tests: