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

Feat: Add ollama, mistral ai and others #4

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Yhozen
Copy link
Contributor

@Yhozen Yhozen commented Jun 15, 2024

This PR switches from OpenAI node library to vercel AI sdk, which abstract many AI apis.

I think a settings section would be a nice addition + the persistent storage added in #3

I would do it but I honestly suck at frontend :(

Adding more models/providers is trivial now with the ai sdk (think of it like the orm or prisma of AI apis)

Screenshots

Screenshot 2024-06-15 at 5 23 03 PM Screenshot 2024-06-15 at 5 23 22 PM

@Yhozen
Copy link
Contributor Author

Yhozen commented Jun 15, 2024

This is WIP since there's no way to add/edit/delete keys (or other settings i.e: ollama url) for providers

@zangjiucheng
Copy link

image

Hi, that's an excellent improvement to the code! This feature is exactly what I need and am working on right now, and I'm also researching this area.

However, when I tested the code on this branch, I noticed that the AI SDK might conflict with the Cross-Origin Resource Sharing (CORS) policy, resulting in a 403 error. I’m unsure of the exact cause, but it seems related to this issue.

A potential solution could be to request with mode: 'no-cors'. I'm not very familiar with the AI SDK library, so let's work together to figure out this issue :)

Test Platform:

  • model: Macbook (M1 pro)
  • system: MacOS 14.5 (23F79)
  • browser: Chromium Engine Version 126.0.6478.57
  • User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36

@Yhozen
Copy link
Contributor Author

Yhozen commented Jun 23, 2024

image Hi, that's an excellent improvement to the code! This feature is exactly what I need and am working on right now, and I'm also researching this area.

However, when I tested the code on this branch, I noticed that the AI SDK might conflict with the Cross-Origin Resource Sharing (CORS) policy, resulting in a 403 error. I’m unsure of the exact cause, but it seems related to this issue.

A potential solution could be to request with mode: 'no-cors'. I'm not very familiar with the AI SDK library, so let's work together to figure out this issue :)

Test Platform:

  • model: Macbook (M1 pro)
  • system: MacOS 14.5 (23F79)
  • browser: Chromium Engine Version 126.0.6478.57
  • User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36

I will give it a try later today!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants