Can't find where or how URL is being appended from #205
Replies: 4 comments 2 replies
-
Hi @leonaemsears look into openai4j library |
Beta Was this translation helpful? Give feedback.
-
The "completions" part is appended in openai4j library, precisely here. But this won't help you much as ollama has an API that is not compatible with OpenAI/LocalAI, so it will require a separate integration in langchain4j. Out of curiosity, why do you need ollama? You can run llama2 or other open models using LocalAI or oobabooga which are supported by langchain4j. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the precise answer. The reason I'm using Ollama is because I could not get LocalAI running on my Mac M2 - I was facing timeout issues which i've mot been able to resolve in standalone or as a Docker as a container. I am prepared to do the integration but just needed to know how the URL is being constructed, before creating a new package for the Ollama integration. You've done a great job with the framework and using Java 8 which is used by most of my clients running AEM |
Beta Was this translation helpful? Give feedback.
-
@leonaemsears in this case you would probably want to use retrofit to integrate with ollama. You can see hugging-face module as an example. Would be happy to get your contribution here! |
Beta Was this translation helpful? Give feedback.
-
Hi,
I'm using langchain4j-examples and am having an issue finding where the URL is being appended from. COMPLETIONS is the offending value added, see log trace below
2023-10-03 00:15:14 [main] dev.ai4j.openai4j.ResponseLoggingInterceptor.log()
My goal is to use the url http://localhost:11434/api/generate to allow integration with Ollama, but I can find where the value completions is being added even when looking at source for langchain4j.
This is my sample code:
LanguageModel model = LocalAiLanguageModel.builder()
.baseUrl("http://localhost:11434/api/generate")
.modelName("mistral")
.maxTokens(3)
.logRequests(true)
.logResponses(true)
.build();
Thanks
Beta Was this translation helpful? Give feedback.
All reactions