FireworksEmbeddings
This will help you get started with Fireworks embedding models using LangChain. For detailed documentation on FireworksEmbeddings
features and configuration options, please refer to the API reference.
Overview
Integration details
Provider | Package |
---|---|
Fireworks | langchain-fireworks |
Setup
To access Fireworks embedding 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 to sign up to Fireworks and generate an API key. Once you’ve done this set the FIREWORKS_API_KEY environment variable:
import getpass
import os
if not os.getenv("FIREWORKS_API_KEY"):
os.environ["FIREWORKS_API_KEY"] = getpass.getpass("Enter your Fireworks API key: ")
If you want to get automated tracing of your model calls you can also set your LangSmith API key by uncommenting below:
# os.environ["LANGSMITH_TRACING"] = "true"
# os.environ["LANGSMITH_API_KEY"] = getpass.getpass("Enter your LangSmith API key: ")
Installation
The LangChain Fireworks integration lives in the langchain-fireworks
package:
%pip install -qU langchain-fireworks
Instantiation
Now we can instantiate our model object and generate chat completions:
from langchain_fireworks import FireworksEmbeddings
embeddings = FireworksEmbeddings(
model="nomic-ai/nomic-embed-text-v1.5",
)