Basically, ChatGeppetto is a Firefox extension that allows you to chat with a LLM hosted on a OobaBooga TextGen interface in api mode, or with OpenAI ChatGPT if you don't have an instance of TextGen and don't care to much about privacy.
The initial idea was taken from Felipe Oliveria's OpenAI-Chatbot a nice and simple widget wrotten in HTML, CSS and Javascript. It inspired me to make a chatbot widget for my SearxNG instance. I wanted to be able to chat with a bot and make him help me in web searches. Then I tought that it would be great if it was ont only on the search engine, but on all the web. So I switched to a Firefox extention.
I'm currently working on bug fixes and porting the extension to Chrome. Feel free to open issues and send pull requests. I stared this project as a holiday project to learn more about LLM, and browser extenions. I still don't know how many time I will be able to spend on it. But I will try to make it better and better.
- Sidebar panel to chat with the bot.
- Open and close the panel with a keyboard shortcut.
- Feed text selection and pages to the bot memory.
- Internet aware bot. The bot can make searches on the internet before answering you.
- Bot configuration with special commands.
- Save and load conversations.
- input history and suggestions from past inputs.
- remove and insert user, bot or system messages in conversation.
- Fullscreen mode, with saved conversations panel
- Supports OpenAI ChatGPT and Oobabooga TextGen.
- Memory management: auto-cleaning of system prompts and auto summarisation of the beginning of the conversation.
- Continue on max tokens reached.
- Copy button to copy the bot answer to the clipboard.
- Syntax highlighting for code in the bot answers.
You need to have several things to be able to use all chatgeppetto features: a
- You need an instance of Oobabooga Text Genaration running with the api mode enabled or an OpenAI api key.
- To make ChatGeppetto internet aware, you need to use a SearxNG searxng instance one is set by Default bu feel free to change it.
- You need to use a Firefox browser with the ChatGeppetto extension installed.
The extention is now available on Firefox Add-ons.
- You need to clone this repository.
- cd into the cloned repository.
- Run
web-ext build
to build the extension. (Instructions to install web-ext can be found here) - Go to
about:addons
in Firefox. - Click on the gear icon and select
Install Add-on From File...
. - if you don't have the "Install Add-on From File..." option, you need
to set the
xpinstall.signatures.required
option to false. - Select the
chatgeppetto-1.0.0.zip
file in theweb-ext-artifacts
directory. - You're done!
- You need to have an instance of Oobabooga Text Generation running.
- In the session tab, activate the API mode and openai.
- If you plan to access it from the internet, you need to configure an api key. add --api-key <my_super_secret_key> to the command line.
- I suggest to make at least one character dedicated to the plugin in
the
parameters
->character
tab. Ideally, you should make à character per language you want to use. For example, a my-super-assistant-en and a my-super-assistant-fr if you want to be able to chat in english and in french. - Or grap an OpenAI api key and use it instead of TextGen.
- Once the extension is installed, type
CTRL + y
to open the ChatGeppetto panel. - To configure the API endpoint, type :set api <api_endpoint> by deafult it points to OpenAI.
- To configure your API key, type :set apikey <api_key>.
- You also need to configure the TextGen prompt template. Type :set template <prompt_template>.
- And the character to use to generate answers. Type :set character <character_name>.
- To configure the searx endpoint, type :set searchEngine <searx_endpoint>.
- Optionally, you can configure the default language for the bot. Type
:set language <language_code>. (Only
en
andfr
available for now) - You can change the name of the bot by typing :set assistant <bot_name>.
- And your name by typing :set you <your_name>.
To chat with the bot, you simply need to type your message in the input field and press enter. The bot will answer you in the chat window.
If you want ChatGeppetto to make a search on the internet before
answering you, you need to finish your prompt with +i
. The answer will
take more time to generate, but it will be more relevant and use recent
data.
You can select text on a page and Drag and Drop it in the input field. The text will be fed to the bot memory and will be used to generate subsequent answers.
The add-on adds a Send Page to ChatGeppetto
entry in the context menu. If you
select this entry, the add-on will read the content of the current page
and feed it to the bot memory. The bot will use this information to
generate subsequent answers.
There is also a Send selection to ChatGeppetto
entry in the context
menu when text is selected. If you select this entry, the add-on will
inject the selected text in the bot memory.
If you want to get ChatGeppetto to read other pages, simply tyle a URL in the input field and press enter or darg and drop a link on the field. The bot memory will be fed with the content od those pages.
Pay attention feeding too much data to the bot memory. It can lead to unexpected results specially with Model with a short context. Mixtral 8x7b works wonders with a large context and is recommended. As a rule of thumb, the longer the context, the slower the generation.
You can use special commands starting with a colon :
to interact with
the bot. Yes, I'm a huge Vim fanboy and I use Surfingkeys in my browser
;-). The availlable commands can be listed by just saying help
to the
bot.
You can save and load conversations. To save a conversation, type
:save <name>
. To load a conversation, type :load <name>
and :list
lists all saved conversations.
When you start typing in the input field, ChatGeppetto will suggest you previous inputs. You can use the up and down arrows to navigate in the suggestions.
Use pop
and push [role] [message]
to remove and insert user, bot
or system messages in the current conversation.
When the bot answers in a dimmed bubble, it means that the answer was a notification and is not saved in the conversation.
Finally, type CTRL + SHIFT + y to enter fullscreen mode. In fullscreen mode a panel with all saved conversations is displayed when you approach the mouse to the left border of the screen. You can click on a conversation to load it.