I have a local service running on https://localhost:PORT/v1
that duplicates the Open AI API functionality available at https://api.openai.com/v1
. It appears the only way to use something like LLMSynthesize is to have an Open AI key. Is it possible to replace the base URL for any LLM calls? I presume one way to do this may be to create a ServiceObject for authentication?
$\begingroup$
$\endgroup$
3
-
$\begingroup$ Hmm... yeah, I "complained" in a relatively recent Community post that it is not clear how to plug in other LLM services in WL's LLM functions framework. In the corresponding Python and Raku packages it is easy. So, are you interested in a Python solution which you can use in Mathematica? $\endgroup$– Anton AntonovCommented Sep 27, 2023 at 19:47
-
1$\begingroup$ Yeah, in Python I'm running vLLM but there are a whole multitude of options for serving local LLMs. Another is llama.cpp. $\endgroup$– James RohalCommented Sep 27, 2023 at 20:17
-
$\begingroup$ Thanks for the link! I was referring to an approach closer to Mathematica's -- "LLMFunctionObjects". $\endgroup$– Anton AntonovCommented Sep 27, 2023 at 20:23
Add a comment
|
1 Answer
$\begingroup$
$\endgroup$
Edit file C:\Program Files\Wolfram Research\Wolfram\14.1\SystemFiles\Components\OpenAI\Kernel\OpenAI.m
For example, LLaMA 3.1 via LM Studio: