Fireworks.ai is a lightning-fast inference platform that serves generative AI models. All the models are exposed over completions and a chat completions API. Using the API, you can build on popular open-source models and custom fine-tuned models like FireFunction, Hermes 2 Pro, etc.

Experience all our models in the model playground!

Quickstart helps you to get started in minutes. However, if you want to explore more, please refer to the guides section or the API reference.

In this guide, you will:

  • Set up your development environment
  • Choose an SDK
  • Call the Fireworks API with an API Key

Account Creation

Create a Fireworks AI account. Under Account Settings, click on API Keys to generate one. Please keep the API Key in a secure location.

Set up developer environment

1

Install SDK

Before installing, ensure that you have the right version of Python installed. Optionally you might want to setup a virtual environment too.

pip install --upgrade fireworks-ai
Fireworks Python Client is OpenAI API Compatible.
2

Configure API Key

Step-by-step instructions for setting an environment variable for respective OS platforms:

3

Sending the first API Request

You can quickly instantiate with the generated API Key and call the Fireworks API.

from fireworks.client import Fireworks

client = Fireworks(api_key="<FIREWORKS_API_KEY>")
response = client.chat.completions.create(
model="accounts/fireworks/models/llama-v2-7b-chat",
messages=[{
   "role": "user",
   "content": "Say this is a test",
}],
)

print(response.choices[0].message.content)

Dive in further

Have fun!

If you have any questions, please reach out to us on Discord or Twitter.