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

Adding ollama api connection #262

Open
ZaMeR12 opened this issue Sep 9, 2024 · 6 comments
Open

Adding ollama api connection #262

ZaMeR12 opened this issue Sep 9, 2024 · 6 comments

Comments

@ZaMeR12
Copy link

ZaMeR12 commented Sep 9, 2024

Hi, i want to do my own chat AI interface for study and personnal project. I find the library interesting, the only problem is that I use Ollama as LLM provider (local server for llms). So Ithink that can be interesting to add Ollama's API to the list of the AI connection possible. That will help people like me to have a framework for it like this one instead to deal with multiple libraries. (ui chat components, axios, material ui,etc...) I understand that is not something to help most people, but certainely be interesting to think about it at least.

Thanks you for your consideration.

@ZaMeR12
Copy link
Author

ZaMeR12 commented Sep 10, 2024

Finally i found that Ollama offer a openapi compatibillity, but this is an experimental function made by Ollama's dev. So it's still not the best option. So i still think that will be a good idea to had a connection for the Ollama initial api.

@keesfluitman
Copy link

keesfluitman commented Oct 2, 2024

Hey @ZaMeR12
Im also looking into this. I was tryingto do it in sveltekit and got a response, but cant get it to stream in chat yet. Im too inexperienced in web dev but ill try it in flask. More capable in flask atm.

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

U wanna pm and try to set it up?

@OvidijusParsiunas
Copy link
Owner

OvidijusParsiunas commented Oct 3, 2024

Hey folks,

Sorry for no response for so long as I currently barely have any free time after work as I just moved to a new country. I am committed to expanding the directConnection APIs that we offer to our users and will explore Ollama in the near future.

Currently, I would advise you to use the connection handler property which allows you to connect to any API out there, so if you have your own server or are connecting to an existing server, I would highly recommend checking it out.

You can also alternatively explore the use of the interceptor functions which allow you to modify the outgoing and incoming messages.

Apologies for the lack of recent developments and I will try to tackle these issues as soon as I get a chance!

Thankyou.

@keesfluitman
Copy link

Hey folks,

Sorry for no response for so long as I currently barely have any free time after work as I just moved to a new country. I am committed to expanding the directConnection APIs that we offer to our users and will explore Ollama in the near future.

Currently, I would advise you to use the connection handler property which allows you to connect to any API out there, so if you have your own server or are connecting to an existing server, I would highly recommend checking it out.

You can also alternatively explore the use of the interceptor functions which allow you to modify the outgoing and incoming messages.

Apologies for the lack of recent developments and I will try to tackle these issues as soon as I get a chance!

Thankyou.

Hey don't worry man. Great free stuff to learn for me! As a little joke Im gonna use it to create a chat for my soccer team, where the parents can ask when the next tournament is and other info (as some parents just never read my website and always call,text or ask privately). Just for a few days, as it will cost me too much power to keep the PC running all the time.

But it wasn't too hard to set it up. In Sveltekit I store the soccerData, retrieve it in page.svelte, have it send with the body to the chat endpoint. Have that extract the data and send it with an initial system prompt, so when a user starts chatting, it's User specific data (so his/her children, matches etc.) is loaded in the llms chat history. With llama3.2 that works perfectly fine.

Even though im still a noob at this javascript stuff though. Never worked with frameworks in javascript, only some flask. Do you also give private lessons by any chance? Or too busy with work? Ill donate for sure, and Im willing to pay a fair price for regular efficient lessons. Or do you know a good place to find help?

@ZaMeR12
Copy link
Author

ZaMeR12 commented Oct 3, 2024

Hey folks,

Sorry for no response for so long as I currently barely have any free time after work as I just moved to a new country. I am committed to expanding the directConnection APIs that we offer to our users and will explore Ollama in the near future.

Currently, I would advise you to use the connection handler property which allows you to connect to any API out there, so if you have your own server or are connecting to an existing server, I would highly recommend checking it out.

You can also alternatively explore the use of the interceptor functions which allow you to modify the outgoing and incoming messages.

Apologies for the lack of recent developments and I will try to tackle these issues as soon as I get a chance!

Thankyou.

No worry, it's just I wanted to use this library to make my codingvtime easuer and faster. So using the alternative wasn't the good idea for my student project. Also with all the project i made in class, i am able to do it kinda globally myself. So like i said that was more to easier my life for what i wanted than other things.

So if i have a simillar project in the future and see that the new versions fit better for me i will use it that time. I mean i have already built my base for my current project so it's will be complex to switch to your library right now.

I wiah you good luck.

@ZaMeR12
Copy link
Author

ZaMeR12 commented Oct 3, 2024

Hey folks,
Sorry for no response for so long as I currently barely have any free time after work as I just moved to a new country. I am committed to expanding the directConnection APIs that we offer to our users and will explore Ollama in the near future.
Currently, I would advise you to use the connection handler property which allows you to connect to any API out there, so if you have your own server or are connecting to an existing server, I would highly recommend checking it out.
You can also alternatively explore the use of the interceptor functions which allow you to modify the outgoing and incoming messages.
Apologies for the lack of recent developments and I will try to tackle these issues as soon as I get a chance!
Thankyou.

Hey don't worry man. Great free stuff to learn for me! As a little joke Im gonna use it to create a chat for my soccer team, where the parents can ask when the next tournament is and other info (as some parents just never read my website and always call,text or ask privately). Just for a few days, as it will cost me too much power to keep the PC running all the time.

But it wasn't too hard to set it up. In Sveltekit I store the soccerData, retrieve it in page.svelte, have it send with the body to the chat endpoint. Have that extract the data and send it with an initial system prompt, so when a user starts chatting, it's User specific data (so his/her children, matches etc.) is loaded in the llms chat history. With llama3.2 that works perfectly fine.

Even though im still a noob at this javascript stuff though. Never worked with frameworks in javascript, only some flask. Do you also give private lessons by any chance? Or too busy with work? Ill donate for sure, and Im willing to pay a fair price for regular efficient lessons. Or do you know a good place to find help?

Hi @keesfluitman , so you want to learn more about javascript and framework with nodejs? I am right now in the end of my computer sciences study (4 years). So i have learn a lot about OOP (object oriented programming) and differents coding language. I learnt to use ExpressJS (back end/api framework) and React (front end/graphical interface framework) in Typescript (typed version of javascript). I also know different type of databases: some oriented logical (MySQL,SQLite) and some oriented document database like MongoDB. So if you are interested, go to my github profile and contact me with my links on here. In there we will figure out if we can do something to make you learn some of these stuff.

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

No branches or pull requests

3 participants