Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Ollama #76

Open
KTheMan opened this issue Jun 8, 2024 · 3 comments
Open

Add support for Ollama #76

KTheMan opened this issue Jun 8, 2024 · 3 comments
Labels
feature New feature or request

Comments

@KTheMan
Copy link

KTheMan commented Jun 8, 2024

I have Ollama instance set up on an external server and think it would be a great, easy fit for this type of add-on if I could hook it in. Opens up use of many more models with better hardware, if the GM has access, IMO

@KingphilAusti
Copy link
Collaborator

So maybe a clearly defined interace to an external model could solve this.

I don't know if we can bulild this as an "easy to use for everyone" solution but could provide an interface which connects to some external model via a few lines of code.

@KTheMan
Copy link
Author

KTheMan commented Jun 12, 2024

Yup, pretty much what I was thinking; shouldn't need much, as Ollama exposes an OpenAI compatible completion endpoint.

From https://ollama.com/blog/openai-compatibility:

import OpenAI from 'openai'

const openai = new OpenAI({
  baseURL: 'http://localhost:11434/v1/',

  // required but ignored
  apiKey: 'ollama',
})

const chatCompletion = await openai.chat.completions.create({
  messages: [{ role: 'user', content: 'Say this is a test' }],
  model: 'llama3',
})

I did a bit of the work over at https://github.com/KTheMan/UnKenny.
I haven't gotten far enough to get a proper response, but it does hit the Ollama endpoint

@KingphilAusti
Copy link
Collaborator

Ah I see. Going for a fork right now was also what I would have suggested. I should be enough to change openai-api, as you did.
What is the error you get? Or how does your response look like?

@TheComamba TheComamba added the feature New feature or request label Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants