-
-
Notifications
You must be signed in to change notification settings - Fork 72
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: provide alternative local/offline solution #56
Comments
At least for the "chat" function, this already works. I've tested the plugin with OpenChat 3.5 running with llama-cpp-python, which has an OpenAI compatible web server. Here's my config: local default_config = require('gp.config')
local agents = { unpack(default_config.agents), {
name = "OpenChat3-5",
chat = true,
command = false,
model = { model = 'openchat_3.5.Q6_K', temperature = '0.5', top_p = 1 },
system_prompt = default_config.agents[1].system_prompt
}
}
gp.setup {
openai_api_key = 'dummy',
openai_api_endpoint = 'http://127.0.0.1:8000/v1/chat/completions',
cmd_prefix = 'Gp',
agents = agents,
chat_topic_gen_model = 'openchat_3.5.Q6_K'
} Note that the I'm not familiar with all the plugin features, but I will be sure to try the "command" later. |
EDIT: this was user error, please disregard. I'm trying this out with LM Studio and it almost works. LM Studio is throwing an error because the [2024-01-30 20:43:15.630] [INFO] Received POST request to /v1/chat/completions with body: {
"model": "gpt-3.5-turbo-16k",
"stream": true,
"messages": [
{
"role": "system",
"content": "You are a general AI assistant.\n\nThe user provided the additional info about how they would like you to respond:\n\n- If you're unsure don't guess and say you don't know instead.\n- Ask question if you need clarification to provide better answer.\n- Think deeply and carefully from first principles step by step.\n- Zoom out first to see the big picture and then zoom in to details.\n- Use Socratic method to improve your thinking and coding skills.\n- Don't elide any code from your output if the answer requires coding.\n- Take a deep breath; You've got this!"
},
{
"role": "user",
"content": "Tell me a joke"
},
{
"role": "assistant",
"content": ""
},
{
"role": "user",
"content": "Summarize the topic of our conversation above in two or three words. Respond only with those words."
}
]
}
[2024-01-30 20:43:15.630] [ERROR] [Server Error] {"title":"'messages' array must only contain objects with a 'content' field that is not empty"} I'm not sure that I have any influence over this in terms of configuration. |
@johnallen3d Hey, this seems weird, I've just tried lmstudio (on linux) against the main branch by just changing If the chat Could you provide more info? Log for the first call if visible, result of I'm slowly cooking support for multiple providers #93 currently working with openAI compatible APIs, Copilot endpoint and Ollama - just added the LMStudio and seems to work in that branch as well. |
Another potential backend for you to consider @Robitx. https://github.com/TabbyML/tabby It looks like the have or are working towards an OpenAI compatible API. The nice thing here is that you could use |
I have tried with Ollama and it works perfectly. It seems that all that is really needed to turn this plugin into a multi client is the ability to overwrite the default api key and endpoint on an agent per agent basis. It would make it even more awesome than it already is. Right now it is possible to write a hook that would do that but it wouldn't play nicely with the agent commands. One would have to effectively wrap them to do the key + endpoint change as well as the actual agent change. |
So if I was using Ollama, I'd just set the openai api endpoint to something like |
@Robitx would would need to be done to offer any OpenAI compatible alternatives to be supported? I'm guessing exposing a open_ai_url on the agent level (defaulting to OpenAI's API) so you could do it on a per agent basis (even mix solutions if you want). I'd be happy to help, I'm really enjoying using this plugin and would love to experiment with open-source models! |
@joshmedeski it's being done at #93 |
Feel free to close, it's merged. |
Ideally via dockers providing callable API.
The text was updated successfully, but these errors were encountered: