Skip to main content

Fireworks AI

Fireworks AI is a generative AI inference platform to run and customize models with industry-leading speed and production-readiness.

Installation and setup

  • Install the Fireworks integration package.

    pip install langchain-fireworks
  • Get a Fireworks API key by signing up at fireworks.ai.

  • Authenticate by setting the FIREWORKS_API_KEY environment variable.

Authentication

There are two ways to authenticate using your Fireworks API key:

  1. Setting the FIREWORKS_API_KEY environment variable.

    os.environ["FIREWORKS_API_KEY"] = "<KEY>"
  2. Setting api_key field in the Fireworks LLM module.

    llm = Fireworks(api_key="<KEY>")

Chat models

See a usage example.

from langchain_fireworks import ChatFireworks
API Reference:ChatFireworks

LLMs

See a usage example.

from langchain_fireworks import Fireworks 
API Reference:Fireworks

Embedding models

See a usage example.

from langchain_fireworks import FireworksEmbeddings 
API Reference:FireworksEmbeddings

Was this page helpful?