fishjar / kiss-translator

A simple, open source bilingual translation extension & Greasemonkey script (一个简约、开源的 双语对照翻译扩展 & 油猴脚本)
https://github.com/fishjar/kiss-translator
GNU General Public License v3.0
2.49k stars 93 forks source link

ollama integration #112

Open xiaominame opened 3 months ago

xiaominame commented 3 months ago

Can ollama be integrated?

fishjar commented 3 months ago

Since there are many AI models and they are updated very quickly, this may be arranged as a later plan.

xiaominame commented 3 months ago

thank you,looking forward to your plan

fishjar commented 2 months ago

I found that the API of ollama is compatible with openai. You can use it by directly filling in the location of openai.

url should be filled in:

http://localhost:11434/v1/chat/completions

However, you need to set an environment variable before starting ollama

OLLAMA_ORIGINS=*

I will preset more openai interfaces in the next version.