Skip to main content
This will help you get started with Goodfire chat models. For detailed documentation of all ChatGoodfire features and configurations head to the PyPI project page, or go directly to the Goodfire SDK docs. All of the Goodfire-specific functionality (e.g. SAE features, variants, etc.) is available via the main goodfire package. This integration is a wrapper around the Goodfire SDK.

Overview

Integration details

Model features

Setup

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

Credentials

Head to Goodfire Settings to sign up to Goodfire and generate an API key. Once you’ve done this set the GOODFIRE_API_KEY environment variable.
To enable automated tracing of your model calls, set your LangSmith API key:

Installation

The LangChain Goodfire integration lives in the langchain-goodfire package:

Instantiation

Now we can instantiate our model object and generate chat completions:

Invocation

Chaining

We can chain our model with a prompt template like so:

Goodfire-specific functionality

To use Goodfire-specific functionality such as SAE features and variants, you can use the goodfire package directly.

API reference

For detailed documentation of all ChatGoodfire features and configurations head to the API reference