Skip to main content
This doc helps you get started with Fireworks AI chat models. For detailed documentation of all ChatFireworks features and configurations head to the API reference. 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.

Overview

Integration details

Model features

Setup

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

Credentials

Head to (fireworks.ai/login to sign up to Fireworks and generate an API key. Once you’ve done this set the FIREWORKS_API_KEY environment variable:
To enable automated tracing of your model calls, set your LangSmith API key:

Installation

The LangChain Fireworks integration lives in the langchain-fireworks package:

Instantiation

Now we can instantiate our model object and generate chat completions:
  • TODO: Update model instantiation with relevant params.

Invocation

API reference

For detailed documentation of all ChatFireworks features and configurations head to the API reference To use the langchain-fireworks package, follow these installation steps:

Basic usage

Setting up

  1. Sign in to Fireworks AI to obtain an API Key to access the models, and make sure it is set as the FIREWORKS_API_KEY environment variable. Once you’ve signed in and obtained an API key, follow these steps to set the FIREWORKS_API_KEY environment variable:
    • Linux/macOS: Open your terminal and execute the following command:
    Note: To make this environment variable persistent across terminal sessions, add the above line to your ~/.bashrc, ~/.bash_profile, or ~/.zshrc file.
    • Windows: For Command Prompt, use:
  2. 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 fireworks.ai.

Calling the model directly

You can call the model directly with string prompts to get completions.

Advanced usage

Tool use: LangChain Agent + fireworks function calling model

Please checkout how to teach Fireworks function calling model to use a calculator in this notebook. Fireworks focus on delivering the best experience for fast model inference as well as tool use. You can check out our blog for more details on how it compares to GPT-4, the punchline is that it is on par with GPT-4 in terms of function calling use cases, but it is way faster and much cheaper.

RAG: LangChain agent + fireworks function calling model + MongoDB + nomic AI embeddings

Please check out the cookbook here for an end to end flow
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.