-
Notifications
You must be signed in to change notification settings - Fork 224
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
[OPIK-610] multi models support and anthropic implementation #957
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks in the good direction in my opinion.
I encourage to keep abstracting the minimum parts that differ per LLM provider, mostly the client instantiation, the calls (normal and streaming) and converting requests and responses from/to the OpenAI format.
Everything out of this, leave it in common classes/services, no need for interfacing them if not needed. This is to avoid unnecessary complexity.
apps/opik-backend/src/main/java/com/comet/opik/domain/llmproviders/LlmProviderFactory.java
Outdated
Show resolved
Hide resolved
.../opik-backend/src/main/java/com/comet/opik/domain/llmproviders/LlmProviderStreamHandler.java
Outdated
Show resolved
Hide resolved
+1 to Andres's comment, there's still a lot that can be moved to a common ancestor class. |
Do you think it's still relevant to the latest version? |
8b7025b
to
3bfb047
Compare
apps/opik-backend/src/main/java/com/comet/opik/domain/llmproviders/LlmProviderFactory.java
Outdated
Show resolved
Hide resolved
apps/opik-backend/src/main/java/com/comet/opik/domain/llmproviders/OpenAi.java
Outdated
Show resolved
Hide resolved
apps/opik-backend/src/main/java/com/comet/opik/domain/llmproviders/OpenAi.java
Show resolved
Hide resolved
apps/opik-backend/src/main/java/com/comet/opik/domain/ChatCompletionService.java
Outdated
Show resolved
Hide resolved
89ae5d8
to
33481ac
Compare
Details
This PR sets the necessary abstractions in order to introduce additional LLM providers to the chat completion resource logic.
In addition, it adds Anthropic as another LLM provider.
Some things to point out:
maxCompletionTokens
to have a value. Therefore, a validation is added. It will probably require some FE changesANTHROPIC_API_KEY
environment variable is setconfig-test.yml
had some invalid values and so parsing them in one of the tests failed. The config file is fixed in this PRIssues
OPIK-610