Skip to main content

<Warning>
**You are currently on a page documenting the use of Fireworks models as text completion models. Many popular models available on Fireworks are [chat completion models](/oss/javascript/langchain/models).**


You may be looking for [this page instead](/oss/javascript/integrations/chat/fireworks/).
</Warning>

Fireworks AI is an AI inference platform to run and customize models. For a list of all models served by Fireworks see the Fireworks docs. This will help you get started with Fireworks completion models (LLMs) using LangChain. For detailed documentation on Fireworks features and configuration options, please refer to the API reference.

Overview

Integration details

ClassPackageLocalSerializablePY supportDownloadsVersion
Fireworks@langchain/communityNPM - DownloadsNPM - Version

Setup

To access Fireworks models you’ll need to create a Fireworks account, get an API key, and install the @langchain/community integration package.

Credentials

Head to fireworks.ai to sign up to Fireworks and generate an API key. Once you’ve done this set the FIREWORKS_API_KEY environment variable:
export FIREWORKS_API_KEY="your-api-key"
If you want to get automated tracing of your model calls you can also set your LangSmith API key by uncommenting below:
# export LANGSMITH_TRACING="true"
# export LANGSMITH_API_KEY="your-api-key"

Installation

The LangChain Fireworks integration lives in the @langchain/community package:
import IntegrationInstallTooltip from "@mdx_components/integration_install_tooltip.mdx";
<IntegrationInstallTooltip></IntegrationInstallTooltip>

<Npm2Yarn>
  @langchain/community @langchain/core
</Npm2Yarn>

Instantiation

Now we can instantiate our model object and generate chat completions:
import { Fireworks } from "@langchain/community/llms/fireworks"

const llm = new Fireworks({
  model: "accounts/fireworks/models/llama-v3-70b-instruct",
  temperature: 0,
  maxTokens: undefined,
  timeout: undefined,
  maxRetries: 2,
  // other params...
})

Invocation

const inputText = "Fireworks is an AI company that "

const completion = await llm.invoke(inputText)
completion
 helps businesses automate their customer support using AI-powered chatbots. We believe that AI can help businesses provide better customer support at a lower cost. Our chatbots are designed to be highly customizable and can be integrated with various platforms such as Facebook Messenger, Slack, and more.

We are looking for a talented and motivated **Machine Learning Engineer** to join our team. As a Machine Learning Engineer at Fireworks, you will be responsible for developing and improving our AI models that power our chatbots. You will work closely with our data scientists, software engineers, and product managers to design, develop, and deploy AI models that can understand and respond to customer inquiries.

**Responsibilities:**

* Develop and improve AI models that can understand and respond to customer inquiries
* Work with data scientists to design and develop new AI models
* Collaborate with software engineers to integrate AI models with our chatbot platform
* Work with product managers to understand customer requirements and develop AI models that meet those requirements
* Develop and maintain data pipelines to support AI model development and deployment
* Develop and maintain tools to monitor and evaluate AI model performance
* Stay up-to-date with the latest developments in AI and machine learning and apply this knowledge to improve our AI models

**Requirements:**

* Bachelor's

API reference

For detailed documentation of all Fireworks features and configurations head to the API reference.
I