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

LangChain integration #4

Closed
nsarrazin opened this issue Mar 21, 2023 · 4 comments
Closed

LangChain integration #4

nsarrazin opened this issue Mar 21, 2023 · 4 comments

Comments

@nsarrazin
Copy link
Member

Pretty low hanging fruit with the wrapper we have, would be great to create a custom LangChain LLM wrapper for llama.cpp.

Then we could use it in the API and do all sorts of cool things with Serge.

@SecretiveShell
Copy link

Hi, I have been planning to work on this and was wondering if there was a way to just run the API server.

@SecretiveShell
Copy link

additionally stop sequences seem to be an issue on the API side.

@nsarrazin
Copy link
Member Author

nsarrazin commented Mar 22, 2023

Hey! Happy to hear you want to tackle this task.

Currently you can't run just the API server. This used to be possible but now that the API & the web server are behind nginx, if you start nginx without the web server it will fail the health check and refuse to start. Shouldn't be too hard to fix though hopefully, I'll have a look at it. In the meanwhile you can still access the API at http://localhost:8008/api/docs.

But regarding the LangChain integration I was thinking that it would also be interesting to make a custom LLM that is a wrapper calling this generate method here.

https://github.com/nsarrazin/serge/blob/b5ff9d154142ca918347604e0fd89dd3b003fab0/api/utils/generate.py#L16

The custom LLM would only be working inside of the api container (as it depends on the llama binary) but this would still allow us to do cool stuff on the front-end of this project.

For interfacing with other projects indeed you will need to run the API server and make a custom LLM for that one.

@maxime-dlabai
Copy link

Did you looked at this repository @nsarrazin ?
Seems good.

https://github.com/linonetwo/langchain-alpaca

robotdjman added a commit to manudiv16/serge that referenced this issue Mar 26, 2023
prebuilt compose file and updates to actions
@gaby gaby closed this as completed Sep 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants