import SwiftUI
import FoundationModels

enum ModelMode {
   case local
   case cloud
}
@Observable class ModelOrchestrator {
   var mode: ModelMode = .local
   let localModel = SystemLanguageModel.default
   let cloudModel = PrivateCloudComputeLanguageModel()
}
struct ModelProfile: LanguageModelSession.DynamicProfile {
   var orchestrator: ModelOrchestrator

   var body: some DynamicProfile {
      switch orchestrator.mode {
      case .local:
         Profile {
            Instructions("Answer in one short paragraph.")
         }
         .model(orchestrator.localModel)
      case .cloud:
         Profile {
            Instructions("Answer thoroughly, with details.")
         }
         .model(orchestrator.cloudModel)
      }
   }
}