diff --git a/Ollama Swift/Assets.xcassets/AppIcon.appiconset/1024.png b/Ollama Swift/Assets.xcassets/AppIcon.appiconset/1024.png new file mode 100644 index 0000000..1e74db4 Binary files /dev/null and b/Ollama Swift/Assets.xcassets/AppIcon.appiconset/1024.png differ diff --git a/Ollama Swift/Assets.xcassets/AppIcon.appiconset/128.png b/Ollama Swift/Assets.xcassets/AppIcon.appiconset/128.png new file mode 100644 index 0000000..c8d6740 Binary files /dev/null and b/Ollama Swift/Assets.xcassets/AppIcon.appiconset/128.png differ diff --git a/Ollama Swift/Assets.xcassets/AppIcon.appiconset/16.png b/Ollama Swift/Assets.xcassets/AppIcon.appiconset/16.png new file mode 100644 index 0000000..0f80a17 Binary files /dev/null and b/Ollama Swift/Assets.xcassets/AppIcon.appiconset/16.png differ diff --git a/Ollama Swift/Assets.xcassets/AppIcon.appiconset/256 1.png b/Ollama Swift/Assets.xcassets/AppIcon.appiconset/256 1.png new file mode 100644 index 0000000..679b1f0 Binary files /dev/null and b/Ollama Swift/Assets.xcassets/AppIcon.appiconset/256 1.png differ diff --git a/Ollama Swift/Assets.xcassets/AppIcon.appiconset/256.png b/Ollama Swift/Assets.xcassets/AppIcon.appiconset/256.png new file mode 100644 index 0000000..679b1f0 Binary files /dev/null and b/Ollama Swift/Assets.xcassets/AppIcon.appiconset/256.png differ diff --git a/Ollama Swift/Assets.xcassets/AppIcon.appiconset/32 1.png b/Ollama Swift/Assets.xcassets/AppIcon.appiconset/32 1.png new file mode 100644 index 0000000..24b28a4 Binary files /dev/null and b/Ollama Swift/Assets.xcassets/AppIcon.appiconset/32 1.png differ diff --git a/Ollama Swift/Assets.xcassets/AppIcon.appiconset/32.png b/Ollama Swift/Assets.xcassets/AppIcon.appiconset/32.png new file mode 100644 index 0000000..24b28a4 Binary files /dev/null and b/Ollama Swift/Assets.xcassets/AppIcon.appiconset/32.png differ diff --git a/Ollama Swift/Assets.xcassets/AppIcon.appiconset/512 1.png b/Ollama Swift/Assets.xcassets/AppIcon.appiconset/512 1.png new file mode 100644 index 0000000..11334a0 Binary files /dev/null and b/Ollama Swift/Assets.xcassets/AppIcon.appiconset/512 1.png differ diff --git a/Ollama Swift/Assets.xcassets/AppIcon.appiconset/512.png b/Ollama Swift/Assets.xcassets/AppIcon.appiconset/512.png new file mode 100644 index 0000000..11334a0 Binary files /dev/null and b/Ollama Swift/Assets.xcassets/AppIcon.appiconset/512.png differ diff --git a/Ollama Swift/Assets.xcassets/AppIcon.appiconset/64.png b/Ollama Swift/Assets.xcassets/AppIcon.appiconset/64.png new file mode 100644 index 0000000..f71e1c0 Binary files /dev/null and b/Ollama Swift/Assets.xcassets/AppIcon.appiconset/64.png differ diff --git a/Ollama Swift/Assets.xcassets/AppIcon.appiconset/Contents.json b/Ollama Swift/Assets.xcassets/AppIcon.appiconset/Contents.json index 25dfa99..e361225 100644 --- a/Ollama Swift/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/Ollama Swift/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,61 +1,61 @@ { "images" : [ { - "filename" : "Ollama16.png", + "filename" : "16.png", "idiom" : "mac", "scale" : "1x", "size" : "16x16" }, { - "filename" : "Ollama32 1.png", + "filename" : "32 1.png", "idiom" : "mac", "scale" : "2x", "size" : "16x16" }, { - "filename" : "Ollama32.png", + "filename" : "32.png", "idiom" : "mac", "scale" : "1x", "size" : "32x32" }, { - "filename" : "Ollama64.png", + "filename" : "64.png", "idiom" : "mac", "scale" : "2x", "size" : "32x32" }, { - "filename" : "Ollama128.png", + "filename" : "128.png", "idiom" : "mac", "scale" : "1x", "size" : "128x128" }, { - "filename" : "Ollama256 1.png", + "filename" : "256 1.png", "idiom" : "mac", "scale" : "2x", "size" : "128x128" }, { - "filename" : "Ollama256.png", + "filename" : "256.png", "idiom" : "mac", "scale" : "1x", "size" : "256x256" }, { - "filename" : "OllamaSwift512.png", + "filename" : "512 1.png", "idiom" : "mac", "scale" : "2x", "size" : "256x256" }, { - "filename" : "OllamaSwift512 1.png", + "filename" : "512.png", "idiom" : "mac", "scale" : "1x", "size" : "512x512" }, { - "filename" : "OllamaSwift.png", + "filename" : "1024.png", "idiom" : "mac", "scale" : "2x", "size" : "512x512" diff --git a/Ollama Swift/Assets.xcassets/AppIcon.appiconset/Ollama128.png b/Ollama Swift/Assets.xcassets/AppIcon.appiconset/Ollama128.png deleted file mode 100644 index 8d00526..0000000 Binary files a/Ollama Swift/Assets.xcassets/AppIcon.appiconset/Ollama128.png and /dev/null differ diff --git a/Ollama Swift/Assets.xcassets/AppIcon.appiconset/Ollama16.png b/Ollama Swift/Assets.xcassets/AppIcon.appiconset/Ollama16.png deleted file mode 100644 index 499ba85..0000000 Binary files a/Ollama Swift/Assets.xcassets/AppIcon.appiconset/Ollama16.png and /dev/null differ diff --git a/Ollama Swift/Assets.xcassets/AppIcon.appiconset/Ollama256 1.png b/Ollama Swift/Assets.xcassets/AppIcon.appiconset/Ollama256 1.png deleted file mode 100644 index 02959d7..0000000 Binary files a/Ollama Swift/Assets.xcassets/AppIcon.appiconset/Ollama256 1.png and /dev/null differ diff --git a/Ollama Swift/Assets.xcassets/AppIcon.appiconset/Ollama256.png b/Ollama Swift/Assets.xcassets/AppIcon.appiconset/Ollama256.png deleted file mode 100644 index 02959d7..0000000 Binary files a/Ollama Swift/Assets.xcassets/AppIcon.appiconset/Ollama256.png and /dev/null differ diff --git a/Ollama Swift/Assets.xcassets/AppIcon.appiconset/Ollama32 1.png b/Ollama Swift/Assets.xcassets/AppIcon.appiconset/Ollama32 1.png deleted file mode 100644 index 35be0d3..0000000 Binary files a/Ollama Swift/Assets.xcassets/AppIcon.appiconset/Ollama32 1.png and /dev/null differ diff --git a/Ollama Swift/Assets.xcassets/AppIcon.appiconset/Ollama32.png b/Ollama Swift/Assets.xcassets/AppIcon.appiconset/Ollama32.png deleted file mode 100644 index 35be0d3..0000000 Binary files a/Ollama Swift/Assets.xcassets/AppIcon.appiconset/Ollama32.png and /dev/null differ diff --git a/Ollama Swift/Assets.xcassets/AppIcon.appiconset/Ollama64.png b/Ollama Swift/Assets.xcassets/AppIcon.appiconset/Ollama64.png deleted file mode 100644 index e7f8589..0000000 Binary files a/Ollama Swift/Assets.xcassets/AppIcon.appiconset/Ollama64.png and /dev/null differ diff --git a/Ollama Swift/Assets.xcassets/AppIcon.appiconset/OllamaSwift.png b/Ollama Swift/Assets.xcassets/AppIcon.appiconset/OllamaSwift.png deleted file mode 100644 index 5924056..0000000 Binary files a/Ollama Swift/Assets.xcassets/AppIcon.appiconset/OllamaSwift.png and /dev/null differ diff --git a/Ollama Swift/Assets.xcassets/AppIcon.appiconset/OllamaSwift512 1.png b/Ollama Swift/Assets.xcassets/AppIcon.appiconset/OllamaSwift512 1.png deleted file mode 100644 index 81ab5c4..0000000 Binary files a/Ollama Swift/Assets.xcassets/AppIcon.appiconset/OllamaSwift512 1.png and /dev/null differ diff --git a/Ollama Swift/Assets.xcassets/AppIcon.appiconset/OllamaSwift512.png b/Ollama Swift/Assets.xcassets/AppIcon.appiconset/OllamaSwift512.png deleted file mode 100644 index 81ab5c4..0000000 Binary files a/Ollama Swift/Assets.xcassets/AppIcon.appiconset/OllamaSwift512.png and /dev/null differ diff --git a/Ollama Swift/Localizable.xcstrings b/Ollama Swift/Localizable.xcstrings index a6f2f77..e609be8 100644 --- a/Ollama Swift/Localizable.xcstrings +++ b/Ollama Swift/Localizable.xcstrings @@ -4,7 +4,7 @@ " Enter prompt..." : { }, - "%lld MB" : { + "%.3f GB" : { }, "%lld/ %lld MB" : { @@ -16,6 +16,9 @@ } } } + }, + "A good starting model is llama2. Simply write the model name in the field above" : { + }, "Add model:" : { "localizations" : { diff --git a/Ollama Swift/Utils/ErrorMessages.swift b/Ollama Swift/Utils/ErrorMessages.swift index d10039e..f4f815a 100644 --- a/Ollama Swift/Utils/ErrorMessages.swift +++ b/Ollama Swift/Utils/ErrorMessages.swift @@ -15,6 +15,10 @@ func invalidDataError(error: Error?) -> ErrorModel{ return ErrorModel(showError: true, errorTitle: "Invalid Data received", errorMessage: "Looks like there is a problem retrieving the data. \(String(describing: error?.localizedDescription)))") } +func invalidTagsDataError(error: Error?) -> ErrorModel{ + return ErrorModel(showError: true, errorTitle: "No models have been detected!", errorMessage: "To download your first model, click on 'Manage Models', and enter a model name in the 'Add Model' field and click download. \(String(describing: error?.localizedDescription))") +} + func invalidResponseError(error: Error?) -> ErrorModel{ return ErrorModel(showError: true, errorTitle: "Invalid Response", errorMessage: "Looks like you are receiving a response other than 200! \(String(describing: error?.localizedDescription)))") } diff --git a/Ollama Swift/Views/ChatView.swift b/Ollama Swift/Views/ChatView.swift index 5fb4da3..6591a06 100644 --- a/Ollama Swift/Views/ChatView.swift +++ b/Ollama Swift/Views/ChatView.swift @@ -27,7 +27,7 @@ struct ChatView: View { if(errorModel.showError){ VStack (alignment: .leading) { Text(errorModel.errorTitle) - .bold() + .font(.title2) .textSelection(.enabled) Text(errorModel.errorMessage) .textSelection(.enabled) @@ -147,7 +147,7 @@ struct ChatView: View { } catch NetError.invalidURL (let error){ errorModel = invalidURLError(error: error) } catch NetError.invalidData (let error){ - errorModel = invalidDataError(error: error) + errorModel = invalidTagsDataError(error: error) } catch NetError.invalidResponse (let error){ errorModel = invalidResponseError(error: error) } catch NetError.unreachable (let error){ diff --git a/Ollama Swift/Views/ManageModelsView.swift b/Ollama Swift/Views/ManageModelsView.swift index 3819394..d512642 100644 --- a/Ollama Swift/Views/ManageModelsView.swift +++ b/Ollama Swift/Views/ManageModelsView.swift @@ -26,8 +26,8 @@ struct ManageModelsView: View { if(errorModel.showError){ VStack (alignment: .leading) { Text(errorModel.errorTitle) - .bold() .textSelection(.enabled) + .font(.title2) Text(errorModel.errorMessage) .textSelection(.enabled) } @@ -54,9 +54,10 @@ struct ManageModelsView: View { Text("Local Models: ") List(tags?.models ?? [], id: \.self){ model in HStack{ - Text(model.name) - Spacer() - Text("\(Int(model.size / 1024 / 1024)) MB") + VStack(alignment: .leading){ + Text(model.name) + Text("\(model.size / 1024 / 1024 / 1024, specifier: "%.3f") GB") + } Spacer() Button{ @@ -66,7 +67,7 @@ struct ManageModelsView: View { .frame(width: 20, height: 30, alignment: .center) } } } - .frame(height: 150) + .frame(height: 200) HStack{ Picker("Duplicate Model:", selection: $toDuplicate) { ForEach(tags?.models ?? [], id: \.self) {model in @@ -98,13 +99,15 @@ struct ManageModelsView: View { Text("\(Int(completedSoFar / 1024 / 1024 ))/ \(Int(totalSize / 1024 / 1024)) MB") } } - VStack{ + VStack(alignment: .leading){ Text("To find the model names to download, checkout: https://ollama.ai/library") - .selectionDisabled(false) + .textSelection(.enabled) + Text("A good starting model is llama2. Simply write the model name in the field above") } + Spacer() } .padding() - .frame(minWidth: 400, idealWidth: 700, minHeight: 600, idealHeight: 800) + .frame(minWidth: 400, idealWidth: 500, minHeight: 600, idealHeight: 800) .task { getTags() } @@ -118,7 +121,7 @@ struct ManageModelsView: View { } catch NetError.invalidURL (let error){ errorModel = invalidURLError(error: error) } catch NetError.invalidData (let error){ - errorModel = invalidDataError(error: error) + errorModel = invalidTagsDataError(error: error) } catch NetError.invalidResponse (let error){ errorModel = invalidResponseError(error: error) } catch NetError.unreachable (let error){ diff --git a/README.md b/README.md index c145569..02844c3 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,14 @@ # Ollama-SwiftUI -A user-friendly interface for [Ollama AI](https://ollama.ai) created in Swift. This application is not directly affiliated with Ollama.ai +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) + -![Ollama SwiftUI](assets/images/OllamaNoBG256.png) +

+ +

+A user-friendly interface for [Ollama AI](https://ollama.ai) created in Swift. This application is not directly affiliated with Ollama.ai **This app requires Ollama to be installed and online to function.** Install Ollama: https://ollama.ai -![Chat dialogue example](assets/images/Example1.png) +![Chat dialogue example](assets/images/LightMode1.png) ## Features 1. Chatting with local Large Language Models. @@ -17,7 +21,7 @@ A user-friendly interface for [Ollama AI](https://ollama.ai) created in Swift. T 8. Light and Dark Mode 9. Localizable interface. Currently Localized in: English and Arabic -![Manage Models example](assets/images/Example2.png) +![Manage Models example](assets/images/LightMode2.png) ## Getting Started: 1. Install Ollama ( https://ollama.ai ) @@ -28,3 +32,11 @@ A user-friendly interface for [Ollama AI](https://ollama.ai) created in Swift. T - Copy and paste the name and press on the download button 5. Select the model from the dropdown in the main page to start your conversation 6. Write your prompt and start the conversation! + +## Dark Mode also available! +![Chat dialogue example darkmode](assets/images/DarkMode1.png) +![Chat dialogue example darkmode](assets/images/DarkMode2.png) + +## Feedback and Contributions: +For bugs and feedback, please create a new issue or email bugs@kghandour.com +Feel free to contribute by creating a Pull request and the best effort will be done to review and merge. diff --git a/assets/images/DarkMode1.png b/assets/images/DarkMode1.png new file mode 100644 index 0000000..7771854 Binary files /dev/null and b/assets/images/DarkMode1.png differ diff --git a/assets/images/DarkMode2.png b/assets/images/DarkMode2.png new file mode 100644 index 0000000..a6c8321 Binary files /dev/null and b/assets/images/DarkMode2.png differ diff --git a/assets/images/Example1.png b/assets/images/Example1.png deleted file mode 100644 index dfdb825..0000000 Binary files a/assets/images/Example1.png and /dev/null differ diff --git a/assets/images/Example2.png b/assets/images/Example2.png deleted file mode 100644 index 075f259..0000000 Binary files a/assets/images/Example2.png and /dev/null differ diff --git a/assets/images/LightMode1.png b/assets/images/LightMode1.png new file mode 100644 index 0000000..854f880 Binary files /dev/null and b/assets/images/LightMode1.png differ diff --git a/assets/images/LightMode2.png b/assets/images/LightMode2.png new file mode 100644 index 0000000..31ce092 Binary files /dev/null and b/assets/images/LightMode2.png differ diff --git a/assets/images/OllamaNoBG256.png b/assets/images/OllamaNoBG256.png deleted file mode 100644 index d798903..0000000 Binary files a/assets/images/OllamaNoBG256.png and /dev/null differ diff --git a/assets/images/OllamaSwift.svg b/assets/images/OllamaSwift.svg new file mode 100644 index 0000000..4f6c8a9 --- /dev/null +++ b/assets/images/OllamaSwift.svg @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +