Git Product home page Git Product logo

mlx-assistant's Introduction

MLX Assistant

MLX Assistant is an AI-powered typing assistant that leverages MLX language models to correct text in real-time. Designed to run in the background, it listens for specific hotkeys to fix typos, casing, and punctuation in the selected text or the current line you're typing. This script is optimized for macOS, taking advantage of MLX's performance on Apple devices.

Prerequisites

  • Python
  • macOS (since MLX is optimized for Apple devices).

Setup

  1. Install Dependencies

First, ensure you have Python installed on your system. Then, install the required Python packages:

pip install pynput pyperclip httpx mlx-lm
  1. macOS Permissions

For the script to work correctly on macOS, you need to grant accessibility and input monitoring permissions to the terminal or IDE you are using to run the script. This is necessary for the script to simulate keyboard inputs and listen for hotkeys.

  • Go to System Preferences > Security & Privacy.
  • Select the Privacy tab.
  • Scroll down and select Accessibility on the left pane.
  • Click the lock icon at the bottom left to make changes (you might need to enter your password).
  • Click the + button and add your Terminal or IDE application.
  • Repeat the above steps for Input Monitoring.
  1. Download the Script

Download mlx-assistant.py to your preferred directory.

Usage

  1. Open a terminal or your IDE in the directory where you downloaded mlx-assistant.py.
  2. Run the script:
python mlx-assistant.py
  1. With the script running in the background, you can use the following hotkeys in any text editor:
  • F9: Fixes the current line you're on.
  • Alt+F10: Fixes the selected text.

The script will automatically replace the text with the corrected version provided by the MLX model. Feel free to change to your preferred keys in the script.

Customization

You can customize the hotkeys and the MLX model used by editing the mlx-assistant.py script. Look for the MLX_MODEL variable to change the model and the keyboard.GlobalHotKeys configuration to modify hotkeys.

Note

This script is designed for macOS users and has been optimized for performance on Apple devices using the MLX platform. Ensure you have the necessary permissions enabled for your terminal or IDE to allow the script to function correctly.

mlx-assistant's People

Contributors

doriandarko avatar

Stargazers

Fu Lin avatar  avatar 夏 avatar linroger avatar  avatar  avatar  avatar Majo Cuprik avatar Lathanao avatar Adeel Ahmad avatar zhiquan036 avatar  avatar Pavel Poláček avatar WhatIfDev avatar Tavis Rudd avatar  avatar fun_dl avatar Yaroslav avatar Patrick avatar 0x4411 avatar  avatar Ângelo Andrade Cirino avatar  avatar Nam Pham avatar Alex Goulielmos avatar Eiichi Nishikawa avatar Reza Sayar avatar Olivier Dobberkau avatar Ashraful Islam avatar Kieran Klaassen avatar redaready avatar  avatar  avatar Will_Baldlygo avatar Michele Capra avatar Ihor Stefurak avatar hujili avatar Guillaume Dumoulin avatar Skale.io Developer Account avatar  avatar Julian Harris avatar Jonathan Yee avatar 0x1orz avatar  avatar Chronos avatar Glavin Wiechert avatar  avatar Lucas Pickup avatar An Tran avatar Akash Singh avatar wison avatar Axel Rock avatar  avatar 爱可可-爱生活 avatar Jonathan Liu avatar Ivo Stock avatar JimmyLv_吕立青 avatar  avatar Ivan Fioravanti avatar Vincent avatar Slava Kurilyak avatar Monir Abu Hilal avatar Anchen avatar  avatar mukul avatar Yip Yew Mun avatar MoNe  avatar Alexander Kyng avatar Chris Dillard avatar  avatar Murat Mayadağ avatar  avatar  avatar Ahmet Karalar avatar Hongwei Qin avatar Fabianigual avatar muhtasham avatar  avatar  avatar Volodymyr Kyrylov avatar Karan Ganesan avatar Abraham Rubinstein avatar Stephen Lizcano avatar David avatar awyugan avatar  avatar Javier Ezpeleta avatar nicekate avatar

Watchers

 avatar  avatar  avatar

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.