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

Enable OpenAI other compatible APIs #15

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

rapatel0
Copy link
Contributor

@rapatel0 rapatel0 commented Apr 22, 2024

Two changes:

  • One added environmental variable to client setup to enable openAI compatible endpoints OPENAI_API_BASE_URL as environmental variable.
  • added strip command to OPENAIKey - Some weirdness happening with jupyter notebooks that requires this.

Tested with ollama and llama3

@rapatel0
Copy link
Contributor Author

Don't merge this yet. Still debugging

@rapatel0
Copy link
Contributor Author

rapatel0 commented Apr 23, 2024

Seems to be working now. Seems like llama3 has some hard coded text that where the "```python" continue from the prompt doesn't work. Added a regex to extract based on code markdown code blocks "```"

Seems to be working on my end but would appreciate a second pair of eyes.

Set OPENAI_API_BASE_URL to http://localhost:11434/v1/ to point to ollama and use llama3
as the instruction and response model. Alternatively you can try groq or something else.

Note the client object is not per model type, so there is no way to mix models between open ones and openai models.

@handrew
Copy link
Owner

handrew commented Apr 23, 2024

Thanks @rapatel0. Could you take a look at some of my comments in the code?

@rapatel0
Copy link
Contributor Author

I can't anything in the review changes on github. Where are the comments?

@handrew
Copy link
Owner

handrew commented Apr 28, 2024

I can't anything in the review changes on github. Where are the comments?

@rapatel0 Just tagged you.

@rapatel0
Copy link
Contributor Author

I might be being a moron here but still don't see anything

image

@handrew
Copy link
Owner

handrew commented Apr 29, 2024

I might be being a moron here but still don't see anything

Hmm, that's odd! I'm not sure why it's not showing up. I'll just write it here:

  1. On line 304: could you

(1) add a space between elif and the string
(2) use double quotes?

Sorry for the nit.

  1. On line 316: I'm a little reticent to start adding too much regex to the repo, which is why I have been dragging my feet on compatibility with GPT-4-Turbo models + a new instruction #8 though I could be convinced. Could you help motivate why we need this for other models?

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

Successfully merging this pull request may close these issues.

3 participants