Code Monkey home page Code Monkey logo

pyollamx's Introduction

PyOllaMx (Ollama + MlX)

Your gateway to both Ollama & Apple MlX models

Inspired by Ollama, Apple MlX projects and frustrated by the dependencies from external applications like Bing, Chat-GPT etc, I wanted to have my own personal chatbot as a native MacOS application. Sure there are alternatives like streamlit, gradio (which are based, thereby needing a browser) or others like Ollamac, LMStudio, mindmac etc which are good but then restrictive in some means (either by license, or paid or not versatile). Also I wanted to enjoy both Ollama (based on llama.cpp) and Mlx models (which are suitable for image generation, audio generation etc and heck I own a mac with Apple silicon ๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป) through a single uniform interface.

All these lead to this project (PyOllaMx) and another sister project called PyOMlx.

I'm using these in my day to day workflow and I intend to keep develop these for my use and benifit.

If you find this valuable, feel free to use it and contribute to this project as well. Please โญ๏ธ this repo to show your support and make my day!

I'm planning on work on next items on this roadmap.md. Feel free to comment your thoughts (if any) and influence my work (if interested)

MacOS DMGs are available in Releases

PyOllaMx vs PyOMlx

PyOllaMx : ChatBot application capable of chatting with both Ollama and Apple MlX models. For this app to function, it needs both Ollama & PyOMlx macos app running. These 2 apps will serve their respective models on localhost for PyOllaMx to chat.

PyOMlx : A Macos App capable of discovering, loading & serving Apple MlX models downloaded from Apple MLX Community repo in hugging face ๐Ÿค—

How to use?

  1. Install Ollama Application & use Ollama CLI to download your desired models
ollama pull <model name>
ollama pull mistral

This command will download the Ollama models in a known location to PyOllaMx

  1. Install MlX Models from Hugging Face repo.

use hugging-face cli

pip install huggingface_hub hf_transfer

export HF_HUB_ENABLE_HF_TRANSFER=1
huggingface-cli download mlx-community/CodeLlama-7b-Python-4bit-MLX

This command will download the MlX models in a known location to PyOllaMx

  1. Now simply open the PyOllaMx and start chatting

sample

  1. Dark mode support - Toggle between Dark & Light mode with a click of the icon
  2. Model settings menu - Brand new settings menu to set the model name and the temperature along with Ollama & MlX model toggle
  3. Streaming support - Streaming support for both chat & search tasks
  4. Brand New Status bar - Status bar that displays the selected mode name, model type & model temperature
  5. Web search enabled for Apple MlX models - Now you can use Apple MlX models to power the web search when choosing the search tab

Click the release version link above โ˜๐Ÿป to view demo gifs explaining the features.

  1. Web search capability (powered by DuckDuckGo search engine via https://github.com/deedy5/duckduckgo_search) a. Web search powered via basic RAG using prompt engineering. More advanced techniques are in pipeline b. Search response will cite clickable sources for easy follow-up / deep dive c. Beneath every search response, search keywords are also shown to verify the search scope d. Easy toggle between chat and search operations
  2. Clear / Erase history
  3. Automatic scroll on chat messages for better user experience
  4. Basic error & exception handling for searches

Limitations:

  • Web search only enabled for Ollama models. Use dolphin-mistral:7b model for better results. MlX model support is planned for next release
  • Search results aren't deterministic and vary vastly among the chosen models. So play with different models to find your optimum
  • Sometimes search results are gibberish. It is due to the fact that search engine RAG is vanilla i.e done via basic prompt engineering without any library support. So re-trigger the same search prompt and see the response once again if the results aren't satisfactory.

Click the release version link above โ˜๐Ÿป to view demo gifs explaining the features.

  • Auto discover Ollama & MlX models. Simply download the models as you do with respective tools and pyOllaMx would pull the models seamlessly
  • Markdown support on chat messages for programming code
  • Selectable Text
  • Temperature control

pyollamx's People

Contributors

kspviswa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

jiangcongtao

pyollamx's Issues

Visual bugs

  1. User Text message is not wrapping within the chat message. The content is overflowing

  2. Everytime the user needs to scroll manually after typing a big text and similarly AI's response needs to be manually scrolled to reveal the full length. An auto scroll would be best option

feat: add clear button for conversation.

Sometime I want a brand new conversation. Currently I have to close the app and reopen. It is better to add a button to clear all conversation.

An alternative is allow to create another window.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.