Skip to content

Create keyboard shortcuts for an LLM using OpenAI GPT, Ollama, HuggingFace with Automator on macOS.

Notifications You must be signed in to change notification settings

radames/LLM-automator

Repository files navigation

LLM-automator

Guides

Huggingface-Backend
Ollama
OpenAI

For a multi-platform solution, consider plock project

Huggingface Backend

Installation

Get HF_TOKEN from https://huggingface.co/settings/tokens

Edit llm-automator.workflow with the Automator app, replace HF_TOKEN with your token.

You may also edit MODEL="mistralai/Mixtral-8x7B-Instruct-v0.1" to use a different LLM from huggingface.co/models

Install the workflow. This essentially copies the workflow to ~/Library/Services/llm-automator.workflow.

Go to System Preferences -> Keyboard -> Shortcuts -> Services -> General -> llm-automator, and set the shortcut to whatever you want, in my case I set it to ⌃⌥⌘M.

Usage

In any OSX application, select some text, and press the shortcut you set in step 3. The selected text will be replaced with the generated text from the model.

Ollama Backend

Install ollama

Run in the background:

ollama run mistral

Install llm-automator-ollama.workflow the same way as above, no need to edit and add token, however you may edit MODEL="mistral", in case you want to use a different model

Vision

vision.mp4

OpenAI

Install llm-automator-openai.workflow the same way as above, however you may edit OPENAI_KEY = "sk-.........." and MODEL = "gpt-4-1106-preview", in case you want to use a different model

image
asdasdsaas.mp4

About

Create keyboard shortcuts for an LLM using OpenAI GPT, Ollama, HuggingFace with Automator on macOS.

Topics

Resources

Stars

Watchers

Forks

Languages