An integration package connecting Fireworks AI with LangChain, providing functionalities for chat models (ChatFireworks) and embedding models (FireworksEmbeddings). The current version is 1.1.0, and the library follows a regular release cadence, often aligned with updates to the broader LangChain ecosystem.
pip install langchain-fireworksVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to initialize `ChatFireworks` with a specific model and make a simple chat completion call, ensuring the API key is provided, preferably via an environment variable. The model `llama-v3p3-70b-instruct` is an example; refer to Fireworks AI for the latest model IDs.
Refer to the official LangChain documentation and migration guides for the latest API usage. Ensure `langchain-core` is updated to a compatible version.
Set the `FIREWORKS_API_KEY` environment variable or pass `fireworks_api_key='your-key'` directly during model instantiation.
Ensure your Python environment is running a compatible version (3.10, 3.11, or 3.12).
Thoroughly test tool use and structured output with your chosen model. Monitor Fireworks AI's release notes and LangChain's changelog for model-specific fixes and improvements. Ensure the latest version of `langchain-fireworks` is installed, as improvements for structured output have been released.
Set the `FIREWORKS_API_KEY` environment variable with your valid Fireworks API key, or pass the `fireworks_api_key` argument directly when initializing `ChatFireworks` or `FireworksEmbeddings`. Example: `os.environ["FIREWORKS_API_KEY"] = "your_api_key"` or `ChatFireworks(fireworks_api_key="your_api_key", ...)`
Ensure that the `model` parameter is explicitly passed when initializing `ChatFireworks` with a valid model identifier. If using Python 3.12 or 3.13, ensure all related `langchain` and `pydantic` packages are updated to compatible versions. Example: `ChatFireworks(model="accounts/fireworks/models/llama-v3-70b-instruct", ...)`
Import `ChatFireworks` (or `FireworksEmbeddings`) directly from `langchain_fireworks`. For chat models: `from langchain_fireworks import ChatFireworks` For embedding models: `from langchain_fireworks import FireworksEmbeddings`