Skip to main content

LLMs

Features (natively supported)​

All LLMs implement the Runnable interface, which comes with default implementations of all methods, ie. ainvoke, batch, abatch, stream, astream. This gives all LLMs basic support for async, streaming and batch, which by default is implemented as below:

  • Async support defaults to calling the respective sync method in asyncio's default thread pool executor. This lets other async functions in your application make progress while the LLM is being executed, by moving this call to a background thread.
  • Streaming support defaults to returning an Iterator (or AsyncIterator in the case of async streaming) of a single value, the final result returned by the underlying LLM provider. This obviously doesn't give you token-by-token streaming, which requires native support from the LLM provider, but ensures your code that expects an iterator of tokens can work for any of our LLM integrations.
  • Batch support defaults to calling the underlying LLM in parallel for each input by making use of a thread pool executor (in the sync batch case) or asyncio.gather (in the async batch case). The concurrency can be controlled with the max_concurrency key in RunnableConfig.

Each LLM integration can optionally provide native implementations for async, streaming or batch, which, for providers that support it, can be more efficient. The table shows, for each integration, which features have been implemented with native support.

ModelInvokeAsync invokeStreamAsync streamBatchAsync batch
AI21βœ…βŒβŒβŒβŒβŒ
AlephAlphaβœ…βŒβŒβŒβŒβŒ
AmazonAPIGatewayβœ…βŒβŒβŒβŒβŒ
Anthropicβœ…βœ…βœ…βœ…βŒβŒ
Anyscaleβœ…βœ…βœ…βœ…βœ…βœ…
Aphroditeβœ…βŒβŒβŒβœ…βŒ
Arceeβœ…βŒβŒβŒβŒβŒ
Aviaryβœ…βŒβŒβŒβŒβŒ
AzureMLOnlineEndpointβœ…βŒβŒβŒβœ…βŒ
AzureOpenAIβœ…βœ…βœ…βœ…βœ…βœ…
BaichuanLLMβœ…βŒβŒβŒβŒβŒ
Bananaβœ…βŒβŒβŒβŒβŒ
Basetenβœ…βŒβŒβŒβŒβŒ
Beamβœ…βŒβŒβŒβŒβŒ
Bedrockβœ…βœ…βœ…βœ…βŒβŒ
CTransformersβœ…βœ…βŒβŒβŒβŒ
CTranslate2βœ…βŒβŒβŒβœ…βŒ
CerebriumAIβœ…βŒβŒβŒβŒβŒ
ChatGLMβœ…βŒβŒβŒβŒβŒ
Clarifaiβœ…βŒβŒβŒβŒβŒ
Cohereβœ…βœ…βŒβŒβŒβŒ
Databricksβœ…βŒβŒβŒβŒβŒ
DeepInfraβœ…βœ…βœ…βœ…βŒβŒ
DeepSparseβœ…βœ…βœ…βœ…βŒβŒ
EdenAIβœ…βœ…βŒβŒβŒβŒ
Fireworksβœ…βœ…βœ…βœ…βœ…βœ…
ForefrontAIβœ…βŒβŒβŒβŒβŒ
Friendliβœ…βœ…βœ…βœ…βŒβŒ
GPT4Allβœ…βŒβŒβŒβŒβŒ
GigaChatβœ…βœ…βœ…βœ…βœ…βœ…
GooglePalmβœ…βŒβœ…βŒβœ…βŒ
GooseAIβœ…βŒβŒβŒβŒβŒ
GradientLLMβœ…βœ…βŒβŒβœ…βœ…
HuggingFaceEndpointβœ…βœ…βœ…βœ…βŒβŒ
HuggingFaceHubβœ…βŒβŒβŒβŒβŒ
HuggingFacePipelineβœ…βŒβŒβŒβœ…βŒ
HuggingFaceTextGenInferenceβœ…βœ…βœ…βœ…βŒβŒ
HumanInputLLMβœ…βŒβŒβŒβŒβŒ
IpexLLMβœ…βŒβŒβŒβŒβŒ
JavelinAIGatewayβœ…βœ…βŒβŒβŒβŒ
KoboldApiLLMβœ…βŒβŒβŒβŒβŒ
Konkoβœ…βœ…βŒβŒβŒβŒ
LlamaCppβœ…βŒβœ…βŒβŒβŒ
Llamafileβœ…βŒβœ…βŒβŒβŒ
MLXPipelineβœ…βŒβœ…βŒβŒβŒ
ManifestWrapperβœ…βŒβŒβŒβŒβŒ
Minimaxβœ…βŒβŒβŒβŒβŒ
Mlflowβœ…βŒβŒβŒβŒβŒ
MlflowAIGatewayβœ…βŒβŒβŒβŒβŒ
Modalβœ…βŒβŒβŒβŒβŒ
MosaicMLβœ…βŒβŒβŒβŒβŒ
NIBittensorLLMβœ…βŒβŒβŒβŒβŒ
NLPCloudβœ…βŒβŒβŒβŒβŒ
Nebulaβœ…βŒβŒβŒβŒβŒ
OCIGenAIβœ…βŒβŒβŒβŒβŒ
OCIModelDeploymentTGIβœ…βŒβŒβŒβŒβŒ
OCIModelDeploymentVLLMβœ…βŒβŒβŒβŒβŒ
OctoAIEndpointβœ…βœ…βœ…βœ…βœ…βœ…
Ollamaβœ…βŒβŒβŒβŒβŒ
OpaquePromptsβœ…βŒβŒβŒβŒβŒ
OpenAIβœ…βœ…βœ…βœ…βœ…βœ…
OpenLLMβœ…βœ…βŒβŒβŒβŒ
OpenLMβœ…βœ…βœ…βœ…βœ…βœ…
PaiEasEndpointβœ…βŒβœ…βŒβŒβŒ
Petalsβœ…βŒβŒβŒβŒβŒ
PipelineAIβœ…βŒβŒβŒβŒβŒ
Predibaseβœ…βŒβŒβŒβŒβŒ
PredictionGuardβœ…βŒβŒβŒβŒβŒ
PromptLayerOpenAIβœ…βŒβŒβŒβŒβŒ
QianfanLLMEndpointβœ…βœ…βœ…βœ…βŒβŒ
RWKVβœ…βŒβŒβŒβŒβŒ
Replicateβœ…βŒβœ…βŒβŒβŒ
SagemakerEndpointβœ…βŒβŒβŒβŒβŒ
SambaStudioβœ…βŒβœ…βŒβŒβŒ
Sambaverseβœ…βŒβœ…βŒβŒβŒ
SelfHostedHuggingFaceLLMβœ…βŒβŒβŒβŒβŒ
SelfHostedPipelineβœ…βŒβŒβŒβŒβŒ
SparkLLMβœ…βŒβœ…βŒβŒβŒ
StochasticAIβœ…βŒβŒβŒβŒβŒ
TextGenβœ…βŒβŒβŒβŒβŒ
TitanTakeoffβœ…βŒβœ…βŒβŒβŒ
TitanTakeoffProβœ…βŒβœ…βŒβŒβŒ
Togetherβœ…βœ…βŒβŒβŒβŒ
Tongyiβœ…βœ…βœ…βœ…βœ…βœ…
VLLMβœ…βŒβŒβŒβœ…βŒ
VLLMOpenAIβœ…βœ…βœ…βœ…βœ…βœ…
VertexAIβœ…βœ…βœ…βŒβœ…βœ…
VertexAIModelGardenβœ…βœ…βŒβŒβœ…βœ…
VolcEngineMaasLLMβœ…βŒβœ…βŒβŒβŒ
WatsonxLLMβœ…βŒβœ…βŒβœ…βŒ
WeightOnlyQuantPipelineβœ…βŒβŒβŒβŒβŒ
Writerβœ…βŒβŒβŒβŒβŒ
Xinferenceβœ…βŒβŒβŒβŒβŒ
YandexGPTβœ…βœ…βŒβŒβŒβŒ
Yuan2βœ…βŒβŒβŒβŒβŒ

Help us out by providing feedback on this documentation page: