Use openwebui with ollama.
Openwebui is compatible with the firefox sidebar.
So grab ollama and your prefered model.
Install openwebui.
Connect openwebui to ollama
Then in firwdox open about:config
And set browser.ml.chat.provider to your local openwebui instance
Google suggests the you might also need to set browser.ml.chat.hideLocalhost to false. But i dont remember having to do that