-
Notifications
You must be signed in to change notification settings - Fork 0
feature/fallback providers #39
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
base: master
Are you sure you want to change the base?
Conversation
|
||
**Note:** Ollama does not provide token usage information, so `input_tokens` and `output_tokens` will always be empty in debug logs and response metadata. Function calls are also not supported with Ollama. | ||
|
||
### Streaming Responses |
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.
moved
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.
I think that there's a lot of abstraction leaks launched to the final user (cache, router, runner, etc.) that are hidden behind default values. Let's try it and see if it works for us.
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.
Really nice features! Next time I would split some of the smaller changes into different PRs.
Closes #34
Implement multi-provider support with provider routing and failover
:providers
list inLlmComposer.Settings
to replace deprecated:provider
and:provider_opts
keys.LlmComposer
to enforce/suggest exclusive use of:providers
and warn about deprecated keys.LlmComposer.ProviderRunner
to handle provider execution, supporting multiple providers with fallback logic.LlmComposer.ProviderRouter
behaviour to define routing strategies for provider selection, failure handling, and blocking.LlmComposer.ProviderRouter.Simple
with exponential backoff blocking on provider failures.LlmComposer.run_completion/3
to delegate to theProviderRunner
for provider selection and execution.LlmComposer.Cache.Ets
by switchingput
anddelete
calls to asynchronous casts for improved performance.response_format
key forresponse_schema
for better definition of structured outputs that works for more than one provider, for the same schema definitionYou may wanna test the router simple.ex that has the backoff blocking of provider, here is a very basic example, make sure to have ollama service stopped or not installed
place the example in
llm_composer
folder and domix run <the example>.ex