Effect CommunityEC
Effect Community7mo ago
5 replies
Afonso Matos

Using Multiple OpenAI Clients for Different Models

I have this situation where I want to use two OpenAIClients.
For embeddings, I want to use the original OpenAI client, but for the language models, I want to use OpenRouter.

So whenever I provide the embedding model, I also need to provide the right client otherwise it's going to go to the wrong API (for example OpenRouter doesn't support embedding models).

So I created a LayerMap but I'm not sure there's much benefit.

How should I do this?
image.png
Was this page helpful?