├── DeepSeek-R1-1.5B-Qwen Swift Demo.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── swiftpm │ │ │ └── Package.resolved │ └── xcuserdata │ │ └── kunalbatra.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── kunalbatra.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist ├── DeepSeek-R1-1.5B-Qwen Swift Demo ├── Assets.xcassets │ ├── AccentColor.colorset │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json ├── ContentView.swift ├── DeepSeek_R1_1_5B_Qwen_Swift_Demo.entitlements ├── DeepSeek_R1_1_5B_Qwen_Swift_DemoApp.swift └── Preview Content │ └── Preview Assets.xcassets │ └── Contents.json ├── LICENSE └── README.md /DeepSeek-R1-1.5B-Qwen Swift Demo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 77; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 873AD6202D3EB2AE008E1D3C /* MarkdownUI in Frameworks */ = {isa = PBXBuildFile; productRef = 873AD61F2D3EB2AE008E1D3C /* MarkdownUI */; }; 11 | 873AD6232D3EB2C0008E1D3C /* MLXModelManager in Frameworks */ = {isa = PBXBuildFile; productRef = 873AD6222D3EB2C0008E1D3C /* MLXModelManager */; }; 12 | /* End PBXBuildFile section */ 13 | 14 | /* Begin PBXFileReference section */ 15 | 873AD60C2D3EB29D008E1D3C /* DeepSeek-R1-1.5B-Qwen Swift Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "DeepSeek-R1-1.5B-Qwen Swift Demo.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 16 | /* End PBXFileReference section */ 17 | 18 | /* Begin PBXFileSystemSynchronizedRootGroup section */ 19 | 873AD60E2D3EB29D008E1D3C /* DeepSeek-R1-1.5B-Qwen Swift Demo */ = { 20 | isa = PBXFileSystemSynchronizedRootGroup; 21 | path = "DeepSeek-R1-1.5B-Qwen Swift Demo"; 22 | sourceTree = ""; 23 | }; 24 | /* End PBXFileSystemSynchronizedRootGroup section */ 25 | 26 | /* Begin PBXFrameworksBuildPhase section */ 27 | 873AD6092D3EB29D008E1D3C /* Frameworks */ = { 28 | isa = PBXFrameworksBuildPhase; 29 | buildActionMask = 2147483647; 30 | files = ( 31 | 873AD6232D3EB2C0008E1D3C /* MLXModelManager in Frameworks */, 32 | 873AD6202D3EB2AE008E1D3C /* MarkdownUI in Frameworks */, 33 | ); 34 | runOnlyForDeploymentPostprocessing = 0; 35 | }; 36 | /* End PBXFrameworksBuildPhase section */ 37 | 38 | /* Begin PBXGroup section */ 39 | 873AD6032D3EB29D008E1D3C = { 40 | isa = PBXGroup; 41 | children = ( 42 | 873AD60E2D3EB29D008E1D3C /* DeepSeek-R1-1.5B-Qwen Swift Demo */, 43 | 873AD60D2D3EB29D008E1D3C /* Products */, 44 | ); 45 | sourceTree = ""; 46 | }; 47 | 873AD60D2D3EB29D008E1D3C /* Products */ = { 48 | isa = PBXGroup; 49 | children = ( 50 | 873AD60C2D3EB29D008E1D3C /* DeepSeek-R1-1.5B-Qwen Swift Demo.app */, 51 | ); 52 | name = Products; 53 | sourceTree = ""; 54 | }; 55 | /* End PBXGroup section */ 56 | 57 | /* Begin PBXNativeTarget section */ 58 | 873AD60B2D3EB29D008E1D3C /* DeepSeek-R1-1.5B-Qwen Swift Demo */ = { 59 | isa = PBXNativeTarget; 60 | buildConfigurationList = 873AD61B2D3EB29E008E1D3C /* Build configuration list for PBXNativeTarget "DeepSeek-R1-1.5B-Qwen Swift Demo" */; 61 | buildPhases = ( 62 | 873AD6082D3EB29D008E1D3C /* Sources */, 63 | 873AD6092D3EB29D008E1D3C /* Frameworks */, 64 | 873AD60A2D3EB29D008E1D3C /* Resources */, 65 | ); 66 | buildRules = ( 67 | ); 68 | dependencies = ( 69 | ); 70 | fileSystemSynchronizedGroups = ( 71 | 873AD60E2D3EB29D008E1D3C /* DeepSeek-R1-1.5B-Qwen Swift Demo */, 72 | ); 73 | name = "DeepSeek-R1-1.5B-Qwen Swift Demo"; 74 | packageProductDependencies = ( 75 | 873AD61F2D3EB2AE008E1D3C /* MarkdownUI */, 76 | 873AD6222D3EB2C0008E1D3C /* MLXModelManager */, 77 | ); 78 | productName = "DeepSeek-R1-1.5B-Qwen Swift Demo"; 79 | productReference = 873AD60C2D3EB29D008E1D3C /* DeepSeek-R1-1.5B-Qwen Swift Demo.app */; 80 | productType = "com.apple.product-type.application"; 81 | }; 82 | /* End PBXNativeTarget section */ 83 | 84 | /* Begin PBXProject section */ 85 | 873AD6042D3EB29D008E1D3C /* Project object */ = { 86 | isa = PBXProject; 87 | attributes = { 88 | BuildIndependentTargetsInParallel = 1; 89 | LastSwiftUpdateCheck = 1600; 90 | LastUpgradeCheck = 1600; 91 | TargetAttributes = { 92 | 873AD60B2D3EB29D008E1D3C = { 93 | CreatedOnToolsVersion = 16.0; 94 | }; 95 | }; 96 | }; 97 | buildConfigurationList = 873AD6072D3EB29D008E1D3C /* Build configuration list for PBXProject "DeepSeek-R1-1.5B-Qwen Swift Demo" */; 98 | developmentRegion = en; 99 | hasScannedForEncodings = 0; 100 | knownRegions = ( 101 | en, 102 | Base, 103 | ); 104 | mainGroup = 873AD6032D3EB29D008E1D3C; 105 | minimizedProjectReferenceProxies = 1; 106 | packageReferences = ( 107 | 873AD61E2D3EB2AE008E1D3C /* XCRemoteSwiftPackageReference "swift-markdown-ui" */, 108 | 873AD6212D3EB2C0008E1D3C /* XCRemoteSwiftPackageReference "MLX-Model-Manager" */, 109 | ); 110 | preferredProjectObjectVersion = 77; 111 | productRefGroup = 873AD60D2D3EB29D008E1D3C /* Products */; 112 | projectDirPath = ""; 113 | projectRoot = ""; 114 | targets = ( 115 | 873AD60B2D3EB29D008E1D3C /* DeepSeek-R1-1.5B-Qwen Swift Demo */, 116 | ); 117 | }; 118 | /* End PBXProject section */ 119 | 120 | /* Begin PBXResourcesBuildPhase section */ 121 | 873AD60A2D3EB29D008E1D3C /* Resources */ = { 122 | isa = PBXResourcesBuildPhase; 123 | buildActionMask = 2147483647; 124 | files = ( 125 | ); 126 | runOnlyForDeploymentPostprocessing = 0; 127 | }; 128 | /* End PBXResourcesBuildPhase section */ 129 | 130 | /* Begin PBXSourcesBuildPhase section */ 131 | 873AD6082D3EB29D008E1D3C /* Sources */ = { 132 | isa = PBXSourcesBuildPhase; 133 | buildActionMask = 2147483647; 134 | files = ( 135 | ); 136 | runOnlyForDeploymentPostprocessing = 0; 137 | }; 138 | /* End PBXSourcesBuildPhase section */ 139 | 140 | /* Begin XCBuildConfiguration section */ 141 | 873AD6192D3EB29E008E1D3C /* Debug */ = { 142 | isa = XCBuildConfiguration; 143 | buildSettings = { 144 | ALWAYS_SEARCH_USER_PATHS = NO; 145 | ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; 146 | CLANG_ANALYZER_NONNULL = YES; 147 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 148 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 149 | CLANG_ENABLE_MODULES = YES; 150 | CLANG_ENABLE_OBJC_ARC = YES; 151 | CLANG_ENABLE_OBJC_WEAK = YES; 152 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 153 | CLANG_WARN_BOOL_CONVERSION = YES; 154 | CLANG_WARN_COMMA = YES; 155 | CLANG_WARN_CONSTANT_CONVERSION = YES; 156 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 157 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 158 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 159 | CLANG_WARN_EMPTY_BODY = YES; 160 | CLANG_WARN_ENUM_CONVERSION = YES; 161 | CLANG_WARN_INFINITE_RECURSION = YES; 162 | CLANG_WARN_INT_CONVERSION = YES; 163 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 164 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 165 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 166 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 167 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 168 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 169 | CLANG_WARN_STRICT_PROTOTYPES = YES; 170 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 171 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 172 | CLANG_WARN_UNREACHABLE_CODE = YES; 173 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 174 | COPY_PHASE_STRIP = NO; 175 | DEBUG_INFORMATION_FORMAT = dwarf; 176 | ENABLE_STRICT_OBJC_MSGSEND = YES; 177 | ENABLE_TESTABILITY = YES; 178 | ENABLE_USER_SCRIPT_SANDBOXING = YES; 179 | GCC_C_LANGUAGE_STANDARD = gnu17; 180 | GCC_DYNAMIC_NO_PIC = NO; 181 | GCC_NO_COMMON_BLOCKS = YES; 182 | GCC_OPTIMIZATION_LEVEL = 0; 183 | GCC_PREPROCESSOR_DEFINITIONS = ( 184 | "DEBUG=1", 185 | "$(inherited)", 186 | ); 187 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 188 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 189 | GCC_WARN_UNDECLARED_SELECTOR = YES; 190 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 191 | GCC_WARN_UNUSED_FUNCTION = YES; 192 | GCC_WARN_UNUSED_VARIABLE = YES; 193 | LOCALIZATION_PREFERS_STRING_CATALOGS = YES; 194 | MACOSX_DEPLOYMENT_TARGET = 15.0; 195 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 196 | MTL_FAST_MATH = YES; 197 | ONLY_ACTIVE_ARCH = YES; 198 | SDKROOT = macosx; 199 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; 200 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 201 | }; 202 | name = Debug; 203 | }; 204 | 873AD61A2D3EB29E008E1D3C /* Release */ = { 205 | isa = XCBuildConfiguration; 206 | buildSettings = { 207 | ALWAYS_SEARCH_USER_PATHS = NO; 208 | ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; 209 | CLANG_ANALYZER_NONNULL = YES; 210 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 211 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 212 | CLANG_ENABLE_MODULES = YES; 213 | CLANG_ENABLE_OBJC_ARC = YES; 214 | CLANG_ENABLE_OBJC_WEAK = YES; 215 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 216 | CLANG_WARN_BOOL_CONVERSION = YES; 217 | CLANG_WARN_COMMA = YES; 218 | CLANG_WARN_CONSTANT_CONVERSION = YES; 219 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 220 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 221 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 222 | CLANG_WARN_EMPTY_BODY = YES; 223 | CLANG_WARN_ENUM_CONVERSION = YES; 224 | CLANG_WARN_INFINITE_RECURSION = YES; 225 | CLANG_WARN_INT_CONVERSION = YES; 226 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 227 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 228 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 229 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 230 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 231 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 232 | CLANG_WARN_STRICT_PROTOTYPES = YES; 233 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 234 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 235 | CLANG_WARN_UNREACHABLE_CODE = YES; 236 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 237 | COPY_PHASE_STRIP = NO; 238 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 239 | ENABLE_NS_ASSERTIONS = NO; 240 | ENABLE_STRICT_OBJC_MSGSEND = YES; 241 | ENABLE_USER_SCRIPT_SANDBOXING = YES; 242 | GCC_C_LANGUAGE_STANDARD = gnu17; 243 | GCC_NO_COMMON_BLOCKS = YES; 244 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 245 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 246 | GCC_WARN_UNDECLARED_SELECTOR = YES; 247 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 248 | GCC_WARN_UNUSED_FUNCTION = YES; 249 | GCC_WARN_UNUSED_VARIABLE = YES; 250 | LOCALIZATION_PREFERS_STRING_CATALOGS = YES; 251 | MACOSX_DEPLOYMENT_TARGET = 15.0; 252 | MTL_ENABLE_DEBUG_INFO = NO; 253 | MTL_FAST_MATH = YES; 254 | SDKROOT = macosx; 255 | SWIFT_COMPILATION_MODE = wholemodule; 256 | }; 257 | name = Release; 258 | }; 259 | 873AD61C2D3EB29E008E1D3C /* Debug */ = { 260 | isa = XCBuildConfiguration; 261 | buildSettings = { 262 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 263 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 264 | CODE_SIGN_ENTITLEMENTS = "DeepSeek-R1-1.5B-Qwen Swift Demo/DeepSeek_R1_1_5B_Qwen_Swift_Demo.entitlements"; 265 | CODE_SIGN_STYLE = Automatic; 266 | COMBINE_HIDPI_IMAGES = YES; 267 | CURRENT_PROJECT_VERSION = 1; 268 | DEVELOPMENT_ASSET_PATHS = "\"DeepSeek-R1-1.5B-Qwen Swift Demo/Preview Content\""; 269 | DEVELOPMENT_TEAM = E3W24N6WAL; 270 | ENABLE_HARDENED_RUNTIME = YES; 271 | ENABLE_PREVIEWS = YES; 272 | GENERATE_INFOPLIST_FILE = YES; 273 | INFOPLIST_KEY_NSHumanReadableCopyright = ""; 274 | LD_RUNPATH_SEARCH_PATHS = ( 275 | "$(inherited)", 276 | "@executable_path/../Frameworks", 277 | ); 278 | MARKETING_VERSION = 1.0; 279 | PRODUCT_BUNDLE_IDENTIFIER = "com.onboto.DeepSeek-R1-1-5B-Qwen-Swift-Demo"; 280 | PRODUCT_NAME = "$(TARGET_NAME)"; 281 | SWIFT_EMIT_LOC_STRINGS = YES; 282 | SWIFT_VERSION = 5.0; 283 | }; 284 | name = Debug; 285 | }; 286 | 873AD61D2D3EB29E008E1D3C /* Release */ = { 287 | isa = XCBuildConfiguration; 288 | buildSettings = { 289 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 290 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 291 | CODE_SIGN_ENTITLEMENTS = "DeepSeek-R1-1.5B-Qwen Swift Demo/DeepSeek_R1_1_5B_Qwen_Swift_Demo.entitlements"; 292 | CODE_SIGN_STYLE = Automatic; 293 | COMBINE_HIDPI_IMAGES = YES; 294 | CURRENT_PROJECT_VERSION = 1; 295 | DEVELOPMENT_ASSET_PATHS = "\"DeepSeek-R1-1.5B-Qwen Swift Demo/Preview Content\""; 296 | DEVELOPMENT_TEAM = E3W24N6WAL; 297 | ENABLE_HARDENED_RUNTIME = YES; 298 | ENABLE_PREVIEWS = YES; 299 | GENERATE_INFOPLIST_FILE = YES; 300 | INFOPLIST_KEY_NSHumanReadableCopyright = ""; 301 | LD_RUNPATH_SEARCH_PATHS = ( 302 | "$(inherited)", 303 | "@executable_path/../Frameworks", 304 | ); 305 | MARKETING_VERSION = 1.0; 306 | PRODUCT_BUNDLE_IDENTIFIER = "com.onboto.DeepSeek-R1-1-5B-Qwen-Swift-Demo"; 307 | PRODUCT_NAME = "$(TARGET_NAME)"; 308 | SWIFT_EMIT_LOC_STRINGS = YES; 309 | SWIFT_VERSION = 5.0; 310 | }; 311 | name = Release; 312 | }; 313 | /* End XCBuildConfiguration section */ 314 | 315 | /* Begin XCConfigurationList section */ 316 | 873AD6072D3EB29D008E1D3C /* Build configuration list for PBXProject "DeepSeek-R1-1.5B-Qwen Swift Demo" */ = { 317 | isa = XCConfigurationList; 318 | buildConfigurations = ( 319 | 873AD6192D3EB29E008E1D3C /* Debug */, 320 | 873AD61A2D3EB29E008E1D3C /* Release */, 321 | ); 322 | defaultConfigurationIsVisible = 0; 323 | defaultConfigurationName = Release; 324 | }; 325 | 873AD61B2D3EB29E008E1D3C /* Build configuration list for PBXNativeTarget "DeepSeek-R1-1.5B-Qwen Swift Demo" */ = { 326 | isa = XCConfigurationList; 327 | buildConfigurations = ( 328 | 873AD61C2D3EB29E008E1D3C /* Debug */, 329 | 873AD61D2D3EB29E008E1D3C /* Release */, 330 | ); 331 | defaultConfigurationIsVisible = 0; 332 | defaultConfigurationName = Release; 333 | }; 334 | /* End XCConfigurationList section */ 335 | 336 | /* Begin XCRemoteSwiftPackageReference section */ 337 | 873AD61E2D3EB2AE008E1D3C /* XCRemoteSwiftPackageReference "swift-markdown-ui" */ = { 338 | isa = XCRemoteSwiftPackageReference; 339 | repositoryURL = "https://github.com/gonzalezreal/swift-markdown-ui"; 340 | requirement = { 341 | kind = upToNextMajorVersion; 342 | minimumVersion = 2.4.1; 343 | }; 344 | }; 345 | 873AD6212D3EB2C0008E1D3C /* XCRemoteSwiftPackageReference "MLX-Model-Manager" */ = { 346 | isa = XCRemoteSwiftPackageReference; 347 | repositoryURL = "https://github.com/kunal732/MLX-Model-Manager"; 348 | requirement = { 349 | branch = main; 350 | kind = branch; 351 | }; 352 | }; 353 | /* End XCRemoteSwiftPackageReference section */ 354 | 355 | /* Begin XCSwiftPackageProductDependency section */ 356 | 873AD61F2D3EB2AE008E1D3C /* MarkdownUI */ = { 357 | isa = XCSwiftPackageProductDependency; 358 | package = 873AD61E2D3EB2AE008E1D3C /* XCRemoteSwiftPackageReference "swift-markdown-ui" */; 359 | productName = MarkdownUI; 360 | }; 361 | 873AD6222D3EB2C0008E1D3C /* MLXModelManager */ = { 362 | isa = XCSwiftPackageProductDependency; 363 | package = 873AD6212D3EB2C0008E1D3C /* XCRemoteSwiftPackageReference "MLX-Model-Manager" */; 364 | productName = MLXModelManager; 365 | }; 366 | /* End XCSwiftPackageProductDependency section */ 367 | }; 368 | rootObject = 873AD6042D3EB29D008E1D3C /* Project object */; 369 | } 370 | -------------------------------------------------------------------------------- /DeepSeek-R1-1.5B-Qwen Swift Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DeepSeek-R1-1.5B-Qwen Swift Demo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved: -------------------------------------------------------------------------------- 1 | { 2 | "originHash" : "ae8eb38bb3b1ad1a07208286712d1314063d9a372dbad2183f5cc405bcd3626c", 3 | "pins" : [ 4 | { 5 | "identity" : "jinja", 6 | "kind" : "remoteSourceControl", 7 | "location" : "https://github.com/maiqingqiang/Jinja", 8 | "state" : { 9 | "revision" : "6dbe4c449469fb586d0f7339f900f0dd4d78b167", 10 | "version" : "1.0.6" 11 | } 12 | }, 13 | { 14 | "identity" : "mlx-model-manager", 15 | "kind" : "remoteSourceControl", 16 | "location" : "https://github.com/kunal732/MLX-Model-Manager", 17 | "state" : { 18 | "branch" : "main", 19 | "revision" : "ba4026699753430330e8a489d8ee3cf6b2fc49fe" 20 | } 21 | }, 22 | { 23 | "identity" : "mlx-swift", 24 | "kind" : "remoteSourceControl", 25 | "location" : "https://github.com/ml-explore/mlx-swift", 26 | "state" : { 27 | "revision" : "70dbb62128a5a1471a5ab80363430adb33470cab", 28 | "version" : "0.21.2" 29 | } 30 | }, 31 | { 32 | "identity" : "networkimage", 33 | "kind" : "remoteSourceControl", 34 | "location" : "https://github.com/gonzalezreal/NetworkImage", 35 | "state" : { 36 | "revision" : "2849f5323265386e200484b0d0f896e73c3411b9", 37 | "version" : "6.0.1" 38 | } 39 | }, 40 | { 41 | "identity" : "swift-argument-parser", 42 | "kind" : "remoteSourceControl", 43 | "location" : "https://github.com/apple/swift-argument-parser.git", 44 | "state" : { 45 | "revision" : "41982a3656a71c768319979febd796c6fd111d5c", 46 | "version" : "1.5.0" 47 | } 48 | }, 49 | { 50 | "identity" : "swift-cmark", 51 | "kind" : "remoteSourceControl", 52 | "location" : "https://github.com/swiftlang/swift-cmark", 53 | "state" : { 54 | "revision" : "3ccff77b2dc5b96b77db3da0d68d28068593fa53", 55 | "version" : "0.5.0" 56 | } 57 | }, 58 | { 59 | "identity" : "swift-markdown-ui", 60 | "kind" : "remoteSourceControl", 61 | "location" : "https://github.com/gonzalezreal/swift-markdown-ui", 62 | "state" : { 63 | "revision" : "5f613358148239d0292c0cef674a3c2314737f9e", 64 | "version" : "2.4.1" 65 | } 66 | }, 67 | { 68 | "identity" : "swift-numerics", 69 | "kind" : "remoteSourceControl", 70 | "location" : "https://github.com/apple/swift-numerics", 71 | "state" : { 72 | "revision" : "0a5bc04095a675662cf24757cc0640aa2204253b", 73 | "version" : "1.0.2" 74 | } 75 | }, 76 | { 77 | "identity" : "swift-transformers", 78 | "kind" : "remoteSourceControl", 79 | "location" : "https://github.com/huggingface/swift-transformers", 80 | "state" : { 81 | "revision" : "d42fdae473c49ea216671da8caae58e102d28709", 82 | "version" : "0.1.14" 83 | } 84 | } 85 | ], 86 | "version" : 3 87 | } 88 | -------------------------------------------------------------------------------- /DeepSeek-R1-1.5B-Qwen Swift Demo.xcodeproj/project.xcworkspace/xcuserdata/kunalbatra.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kunal732/mlx-swift-deepseek/a3d280e76f6082c9b63a388ceaad574c207c5ce6/DeepSeek-R1-1.5B-Qwen Swift Demo.xcodeproj/project.xcworkspace/xcuserdata/kunalbatra.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /DeepSeek-R1-1.5B-Qwen Swift Demo.xcodeproj/xcuserdata/kunalbatra.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | DeepSeek-R1-1.5B-Qwen Swift Demo.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /DeepSeek-R1-1.5B-Qwen Swift Demo/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /DeepSeek-R1-1.5B-Qwen Swift Demo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "scale" : "1x", 6 | "size" : "16x16" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "scale" : "2x", 11 | "size" : "16x16" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "scale" : "1x", 16 | "size" : "32x32" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "scale" : "2x", 21 | "size" : "32x32" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "scale" : "1x", 26 | "size" : "128x128" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "scale" : "2x", 31 | "size" : "128x128" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "scale" : "1x", 36 | "size" : "256x256" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "scale" : "2x", 41 | "size" : "256x256" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "scale" : "1x", 46 | "size" : "512x512" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "scale" : "2x", 51 | "size" : "512x512" 52 | } 53 | ], 54 | "info" : { 55 | "author" : "xcode", 56 | "version" : 1 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /DeepSeek-R1-1.5B-Qwen Swift Demo/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /DeepSeek-R1-1.5B-Qwen Swift Demo/ContentView.swift: -------------------------------------------------------------------------------- 1 | 2 | import SwiftUI 3 | import MLXModelManager 4 | import MarkdownUI 5 | 6 | struct ContentView: View { 7 | @StateObject var DeepSeekManager = ModelManager(modelPath: "mlx-community/deepseek-r1-distill-qwen-1.5b") 8 | 9 | @State var prompt = "what is superposition in physics" 10 | 11 | var body: some View { 12 | VStack(alignment: .leading) { 13 | 14 | // Top controls: progress indicators 15 | HStack { 16 | Spacer() 17 | 18 | if DeepSeekManager.isLoading { 19 | VStack { 20 | ProgressView( 21 | value: Double(DeepSeekManager.progressPercent), 22 | total: 100 23 | ) { 24 | Text("Downloading Model...") 25 | } 26 | .frame(maxWidth: 200) 27 | 28 | Text("\(DeepSeekManager.progressPercent)%") 29 | .font(.subheadline) 30 | } 31 | } 32 | 33 | Spacer() 34 | } 35 | 36 | // Scrollable output (Markdown only) 37 | ScrollView(.vertical) { 38 | ScrollViewReader { scrollProxy in 39 | Markdown(DeepSeekManager.output) 40 | .textSelection(.enabled) 41 | .onChange(of: DeepSeekManager.output) { _, _ in 42 | scrollProxy.scrollTo("bottom", anchor: .bottom) 43 | } 44 | 45 | // "Bottom" spacer 46 | Spacer() 47 | .frame(width: 1, height: 1) 48 | .id("bottom") 49 | } 50 | } 51 | 52 | // Prompt input + "Answer Prompt" button 53 | HStack { 54 | TextField("prompt", text: $prompt) 55 | .onSubmit { answerPrompt() } 56 | .disabled(DeepSeekManager.isGenerating || DeepSeekManager.isLoading) 57 | .textFieldStyle(.roundedBorder) 58 | 59 | Button("Answer Prompt") { 60 | answerPrompt() 61 | } 62 | .disabled(DeepSeekManager.isGenerating || DeepSeekManager.isLoading) 63 | } 64 | } 65 | .padding() 66 | .task { 67 | // Optionally pre-load the model on launch 68 | do { 69 | try await DeepSeekManager.loadModel() 70 | } catch { 71 | print("Failed to load model: \(error)") 72 | } 73 | } 74 | } 75 | 76 | /// Trigger text generation using the current prompt 77 | private func answerPrompt() { 78 | Task { 79 | try await DeepSeekManager.loadModel() 80 | await DeepSeekManager.generate(prompt: prompt) 81 | } 82 | } 83 | } 84 | 85 | #Preview { 86 | ContentView() 87 | } 88 | -------------------------------------------------------------------------------- /DeepSeek-R1-1.5B-Qwen Swift Demo/DeepSeek_R1_1_5B_Qwen_Swift_Demo.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.files.user-selected.read-only 8 | 9 | com.apple.security.network.client 10 | 11 | com.apple.security.network.server 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /DeepSeek-R1-1.5B-Qwen Swift Demo/DeepSeek_R1_1_5B_Qwen_Swift_DemoApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DeepSeek_R1_1_5B_Qwen_Swift_DemoApp.swift 3 | // DeepSeek-R1-1.5B-Qwen Swift Demo 4 | // 5 | // Created by KUNAL BATRA on 1/20/25. 6 | // 7 | 8 | import SwiftUI 9 | 10 | @main 11 | struct DeepSeek_R1_1_5B_Qwen_Swift_DemoApp: App { 12 | var body: some Scene { 13 | WindowGroup { 14 | ContentView() 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /DeepSeek-R1-1.5B-Qwen Swift Demo/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2025 Kunal Batra 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DeepSeek-R1-Distill-Qwen-1.5B in Swift with MLX Model Manager 2 | 3 | This Swift app demonstrates running the [DeepSeek-R1-Distill-Qwen-1.5B Model](https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B) locally using [MLX Model Manager](https://github.com/kunal732/MLX-Model-Manager). The app also integrates [SwiftMarkdownUI](https://github.com/gonzalezreal/swift-markdown-ui) to render model-generated responses in a clean, readable format. 4 | 5 | > **Note**: Still trying to figure out a good way to classify the thought portion of model output vs the answer. 6 | 7 | ## Dependencies 8 | 1. [MLX Model Manager](https://github.com/kunal732/MLX-Model-Manager): For managing and running MLX models locally. 9 | 2. [SwiftMarkdownUI](https://github.com/gonzalezreal/swift-markdown-ui): For rendering Markdown content. 10 | 11 | ## License 12 | This project is licensed under the MIT License. See [LICENSE](LICENSE) for details. 13 | 14 | --------------------------------------------------------------------------------