ChatOpenAI speaks the OpenAI REST API. Point it at RunInfra by overriding the base URL and key.
Install
Chat model
Embeddings
Streaming
Tool calling via LangChain agents
RAG with LangChain + RunInfra embeddings
Known gotchas
- Pass a model id returned by
GET /v1/models. For multi-model pipelines, pass the alias you configured in chat. - Streaming callbacks (
StreamingStdOutCallbackHandler) work unchanged. - LangChain retries use exponential backoff. Pair with
max_retries=3and let the library handle 429s.
Next steps
LlamaIndex
Same OpenAI-base pattern for LlamaIndex.
OpenAI compatibility
The underlying contract.
RAG cookbook
Runnable end-to-end RAG example.
Tool calling cookbook
Raw OpenAI tool loop (no framework).