GigaChat large language models API.
To use, you should pass login and password to access GigaChat API or use token.
Friendli LLM for chat.
friendli-client package should be installed with pip install friendli-client.
You must set FRIENDLI_TOKEN environment variable or provide the value of your
personal a
Parameters for the Javelin AI Gateway LLM.
Javelin AI Gateway chat models API.
To use, you should have the javelin_sdk python package installed.
For more information, see https://docs.getjavelin.io
Writer chat model.
To use, you should have the writer-sdk Python package installed, and the
environment variable WRITER_API_KEY set with your API key or pass 'api_key'
init param.
Fake ChatModel for testing purposes.
Fake ChatModel for testing purposes.
Implements the BaseChatModel (and BaseLanguageModel) interface with Cohere's
large language models.
Find out more about us at https://cohere.com and https://huggingface.co/CohereForAI
This imple
Error with the LiteLLM I/O library
Chat model that uses the LiteLLM API.
Yi chat models API.
Error with the Google PaLM API.
Google PaLM Chat models API.
To use you must have the google.generativeai Python package installed and either:
1. The ``GOOGLE_API_KEY`` environment variable set with your API key, or
2. P
Tencent Hunyuan chat models API by Tencent.
For more information, see https://cloud.tencent.com/document/product/1729
NCP ClovaStudio Chat Completion API.
following environment variables set or passed in constructor in lower case:
NCP_CLOVASTUDIO_API_KEYNCP_APIGW_API_KEYParameters for the MLflow AI Gateway LLM.
MLflow AI Gateway chat models API.
To use, you should have the mlflow[gateway] python package installed.
For more information, see https://mlflow.org/docs/latest/gateway/index.html.
Nebula chat large language model - https://docs.symbl.ai/docs/nebula-llm
API Reference: https://docs.symbl.ai/reference/nebula-chat
To use, set the environment variable NEBULA_API_KEY,
or pass
ChatOCIGenAI chat model integration.
Content formatter for LLaMA.
Chat Content formatter for models with OpenAI like API scheme.
Deprecated: Kept for backwards compatibility
Chat Content formatter for Llama.
Content formatter for Mistral.
Azure ML Online Endpoint chat models.
MiniMax chat model integration.
Perplexity AI Chat models API.
Moonshot chat model integration.
Alibaba Cloud PAI-EAS LLM Service chat model API.
To use, must have a deployed eas chat llm service on AliCloud. One can set the
environment variable eas_service_url and eas_service_token
Baichuan chat model integration.
Dappier chat large language models.
Dappier is a platform enabling access to diverse, real-time data models.
Enhance your AI applications with Dappier's pre-trained, LLM-ready data models
and ens
IFlyTek Spark chat model integration.
Kinetica utility functions.
Kinetica LLM Chat Model API.
Prerequisites for using this API:
gpudb and typeguard packages installed.KINETICA_URLResponse containing SQL and the fetched data.
This object is returned by a chain with KineticaSqlOutputParser and it contains
the generated SQL and related Pandas Dataframe fetched from the datab
Fetch and return data from the Kinetica LLM.
This object is used as the last element of a chain to execute generated SQL and it
will output a KineticaSqlResponse containing the SQL and a pandas d
MariTalk Chat models API.
This class allows interacting with the MariTalk chatbot API. To use it, you must provide an API key either through the constructor.
EdenAI chat large language models.
EdenAI is a versatile platform that allows you to access various language models
from different providers such as Google, OpenAI, Cohere, Mistral and more.
To
MLflow chat models API.
To use, you should have the mlflow[genai] python package installed.
For more information, see https://mlflow.org/docs/latest/llms/deployments.
Reka chat large language models.
Hugging Face LLM's as ChatModels.
Works with HuggingFaceTextGenInference, HuggingFaceEndpoint,
HuggingFaceHub, and HuggingFacePipeline LLMs.
Upon instantiating this class, the model_id is re
llama.cpp model.
To use, you should have the llama-cpp-python library installed, and provide the path to the Llama model as a named parameter to the constructor. Check out: https://github.com/abetlen
Anyscale Chat large language models.
See https://www.anyscale.com/ for information about Anyscale.
To use, you should have the openai python package installed, and the
environment variable ``A
Error with the PremAI API.
PremAI Chat models.
To use, you will need to have an API key. You can find your existing API Key or generate a new one here: https://app.premai.io/api_keys/
EverlyAI Chat large language models.
To use, you should have the openai python package installed, and the
environment variable EVERLYAI_API_KEY set with your API key.
Alternatively, you can
ChatModel which returns user input as the response.
Chat with LLMs via llama-api-server
For the information about llama-api-server, visit https://github.com/second-state/LlamaEdge
Fireworks Chat large language models API.
To use, you should have the
environment variable FIREWORKS_API_KEY set with your API key.
Any parameters that are valid to be passed to the fireworks.cr
Ollama chat model integration.
Install langchain-ollama and download any models you want to use from ollama.
ollama pull gpt-oss:20b
pip install -U langc
<!--/ADMON-->
Volc Engine Maas hosts a plethora of models.
You can utilize these models through this class.
To use, you should have the volcengine python package installed.
and set access key and secret key b
Adapter class to prepare the inputs from Langchain to prompt format that Chat model expects.
Error with Snowpark client.
Snowflake Cortex based Chat model
To use the chat model, you must have the snowflake-snowpark-python Python
package installed and either:
1. environment variables set with your snowflake cre
OctoAI Chat large language models.
See https://octo.ai/ for information about OctoAI.
To use, you should have the openai python package installed and the
environment variable ``OCTOAI_API_TOKEN`
ChatKonko Chat large language models API.
To use, you should have the konko python package installed, and the
environment variable KONKO_API_KEY and OPENAI_API_KEY set with your API key
ZhipuAI chat model integration.
Alibaba Tongyi Qwen chat model integration.
YandexGPT large language models.
There are two authentication options for the service account
with the ai.languageModels.user role:
- You can specify the token in a constructor parameter `iam
OCI Data Science Model Deployment chat model integration.
Prerequisite The OCI Model Deployment plugins are installable only on python version 3.9 and above. If you're working ins
OCI large language chat models deployed with vLLM.
To use, you must provide the model HTTP endpoint from your deployed
model, e.g. https://modeldeployment.us-ashburn-1.oci.customer-oci.com/
OCI large language chat models deployed with Text Generation Inference.
To use, you must provide the model HTTP endpoint from your deployed model, e.g. https://modeldeployment.us-ashburn-1.oci.custom
ChatCoze chat models API by coze.com
For more information, see https://www.coze.com/open/docs/chat
Jina AI Chat models API.
To use, you should have the openai python package installed, and the
environment variable JINACHAT_API_KEY set to your API key, which you
can generate at https://ch
Error with the GPTRouter APIs
GPTRouter model.
GPTRouter by Writesonic Inc.
For more information, see https://gpt-router.writesonic.com/docs
Outlines chat model integration.
LiteLLM Router as LangChain Model.
Anthropic (Claude) chat models.
See the LangChain docs for ChatAnthropic
for tutorials, feature walkthroughs, and examples.
See
MLX chat models.
Works with MLXPipeline LLM.
To use, you should have the mlx-lm python package installed.
Baidu Qianfan chat model integration.
Exception raised when the DeepInfra API returns an error.
A chat model that uses the DeepInfra API.
Azure OpenAI chat model integration.
Yuan2.0 Chat models API.
To use, you should have the openai-python package installed, if package
not installed, using pip install openai to install it. The
environment variable ``YUAN2_AP
PromptLayer and OpenAI Chat large language models API.
To use, you should have the openai and promptlayer python
package installed, and the environment variable OPENAI_API_KEY
and ``P
OpenAI Chat large language models API.
To use, you should have the openai python package installed, and the
environment variable OPENAI_API_KEY set with your API key.
Any parameters that a
ERNIE-Bot large language model.
ERNIE-Bot is a large language model developed by Baidu, covering a huge amount of Chinese data.
To use, you should have the ernie_client_id and `ernie_client_secr
Google Cloud Vertex AI chat model integration.
Get role of the message.
Get a request of the Friendli chat API.
Use tenacity to retry the completion call.
Convert a list of messages to a prompt for llama.
Use tenacity to retry the completion call.
Use tenacity to retry the async completion call.
Context manager for connecting to an SSE stream.
Async context manager for connecting to an SSE stream.
Use tenacity to retry the async completion call.
Async context manager for connecting to an SSE stream.
Process a single content item.
Process content to handle both text and media inputs, returning a list of content items.
Convert LangChain messages to Reka message format.
Create a retry decorator for PremAI API errors.
Using tenacity for retry in completion call
Convert a dictionary to a LangChain message.
Conditionally apply a decorator.
Use tenacity to retry the completion call.
Use tenacity to retry the completion call for streaming.
Convert a dict to a message.
Convert a list of messages to a prompt for mistral.
Context manager for connecting to an SSE stream.
Async context manager for connecting to an SSE stream.
Convert a dict to a message.
Convert a message chunk to a message.
Convert a message to a dict.
Use tenacity to retry the completion call.
Use tenacity to retry the async completion call.
Use tenacity to retry the async completion call.
Return the body for the model router input.
Use tenacity to retry the completion call.
Use tenacity to retry the async completion call.
Get llm output from usage and params.
Format a list of messages into a full prompt for the Anthropic model Args: messages (List[BaseMessage]): List of BaseMessage to combine. human_prompt (str, optional): Human prompt
Convert a message to a dictionary that can be passed to the API.
Use tenacity to retry the async completion call.
Get the request for the Cohere V1 chat API.
.. deprecated:: 0.6.0 V1 API request builder. Will be removed in 1.0.0.