Jan.AI with Ollama (working solution)
If you want to use ollama available models in Jan.AI then you are in correct place.
When I was doing there was/is no way to achieve it even if I tried to add new provider but it didn't worked.
When I tried to find solution on internet then I found pages:
First github issue suggest
"Ollama does not have openai compatible API, it will need another extension to integrate"
Second blog suggested
"Settings > General > Engines > Install Engine > the add url suggested by blog"
But,
Ollama official blogĀ suggest
"Ollama now has built-in compatibility with the OpenAI Chat Completions API, making it possible to use more tooling and applications with Ollama locally."
Source: https://ollama.com/blog/openai-compatibility
&
In second blog as it states we need to go to General > Engines for me there is no Engines anywhere in my Jan application
So there was/is no current working way.
After struggling to make it working I found a way to make it working.
Follow below steps:
- Go to Settings > Model Providers
- Click OpenAI
- In API Key field add
ollama
as api key & in Base URL enterhttp://localhost:11434/v1
equivalent endpoint. - In Models list you can see many already available models of OpenAI you can keep it or delete it (but it's optional)
- In Models there is and option to add new model (there is plus icon), so click on it and add you local ollama model name in my case it was
qwen2.5-coder:14b
(to see available models with exact name runollama list
command in terminal) - Save the model (optional: After saving you will see your model in Models list you can click edit and enable tool calling if your model support it and you want it)
After following above step go to chat and select your model and start chatting.
You may also like
Next.js App Router: Cookies Working Locally but Failing in Production
Struggling with cookie management in production on Next.js? Discover...
Continue readingUnable to Play Audio in Production but in Local It's Working
Unable to Play Audio in Production but in Local It's Working
Continue readingWorking with Python and Databases
Python is a versatile language used for developing applications in v...
Continue reading