Skip to main contentü¶úÔ∏èüîó LangChainDocsUse casesIntegrationsAPICommunityChat our docsLangSmithJS/TS DocsSearchCTRLKProvidersAnthropicAWSGoogleMicrosoftOpenAIMoreComponentsLLMsChat modelsChat modelsAnthropicAnthropic FunctionsAnyscaleAzureAzureML Chat Online EndpointBaichuan ChatBaidu QianfanBedrock ChatCohereERNIE-Bot ChatEverlyAIFireworksGCP Vertex AIJinaChatKonkoüöÖ LiteLLMLlama APIMiniMaxOllamaOpenAIPromptLayer ChatOpenAITongyi QwenvLLM ChatYandexGPTDocument loadersDocument transformersText embedding modelsVector storesRetrieversToolsAgents and toolkitsMemoryCallbacksChat loadersComponentsChat modelsFireworksFireworksFireworks accelerates product development on generative AI by creating an innovative AI experiment and production platform. This example goes over how to use LangChain to interact with ChatFireworks models.from langchain.chat_models.fireworks import ChatFireworksfrom langchain.schema import SystemMessage, HumanMessageimport osSetupMake sure the fireworks-ai package is installed in your environment.Sign in to Fireworks AI for the an API Key to access our models, and make sure it is set as the FIREWORKS_API_KEY environment variable.Set up your model using a model id. If the model is not set, the default model is fireworks-llama-v2-7b-chat. See the full, most up-to-date model list on app.fireworks.ai.import osimport getpassif "FIREWORKS_API_KEY" not in os.environ:    os.environ["FIREWORKS_API_KEY"] = getpass.getpass("Fireworks API Key:")# Initialize a Fireworks chat modelchat = ChatFireworks(model="accounts/fireworks/models/llama-v2-13b-chat")Calling the Model DirectlyYou can call the model directly with a system and human message to get answers.# ChatFireworks Wrappersystem_message = SystemMessage(content="You are to chat with the user.")human_message = HumanMessage(content="Who are you?")chat([system_message, human_message])    AIMessage(content="Hello! My name is LLaMA, I'm a large language model trained by a team of researcher at Meta AI. My
Fireworks accelerates product development on generative AI by creating an innovative AI experiment and production platform.
Fireworks accelerates product development on generative AI by creating an innovative AI experiment and production platform. ->: Skip to main contentü¶úÔ∏èüîó LangChainDocsUse casesIntegrationsAPICommunityChat our docsLangSmithJS/TS DocsSearchCTRLKProvidersAnthropicAWSGoogleMicrosoftOpenAIMoreComponentsLLMsChat modelsChat modelsAnthropicAnthropic FunctionsAnyscaleAzureAzureML Chat Online EndpointBaichuan ChatBaidu QianfanBedrock ChatCohereERNIE-Bot ChatEverlyAIFireworksGCP Vertex AIJinaChatKonkoüöÖ LiteLLMLlama APIMiniMaxOllamaOpenAIPromptLayer ChatOpenAITongyi QwenvLLM ChatYandexGPTDocument loadersDocument transformersText embedding modelsVector storesRetrieversToolsAgents and toolkitsMemoryCallbacksChat loadersComponentsChat modelsFireworksFireworksFireworks accelerates product development on generative AI by creating an innovative AI experiment and production platform. This example goes over how to use LangChain to interact with ChatFireworks models.from langchain.chat_models.fireworks import ChatFireworksfrom langchain.schema import SystemMessage, HumanMessageimport osSetupMake sure the fireworks-ai package is installed in your environment.Sign in to Fireworks AI for the an API Key to access our models, and make sure it is set as the FIREWORKS_API_KEY environment variable.Set up your model using a model id. If the model is not set, the default model is fireworks-llama-v2-7b-chat. See the full, most up-to-date model list on app.fireworks.ai.import osimport getpassif "FIREWORKS_API_KEY" not in os.environ:    os.environ["FIREWORKS_API_KEY"] = getpass.getpass("Fireworks API Key:")# Initialize a Fireworks chat modelchat = ChatFireworks(model="accounts/fireworks/models/llama-v2-13b-chat")Calling the Model DirectlyYou can call the model directly with a system and human message to get answers.# ChatFireworks Wrappersystem_message = SystemMessage(content="You are to chat with the user.")human_message = HumanMessage(content="Who are you?")chat([system_message, human_message])    AIMessage(content="Hello! My name is LLaMA, I'm a large language model trained by a team of researcher at Meta AI. My