Fireworks AI integration for LangChain.
Fireworks Chat large language models API.
To use, you should have the
environment variable FIREWORKS_API_KEY set with your API key.
Any parameters that are valid to be passed to the fireworks.create call can be passed in, even if not explicitly saved on this class.
LLM models from Fireworks.
To use, you'll need an API key. This can be passed in as
init param fireworks_api_key or set as environment variable
FIREWORKS_API_KEY.
Wrapper around Fireworks AI's Completion API.
Main entrypoint into package.
Fireworks chat wrapper.
Model profile data. All edits should be made in profile_augmentations.toml.
Fireworks embedding model integration.
Setup:
Install langchain_fireworks and set environment variable
FIREWORKS_API_KEY.
pip install -U langchain_fireworks
export FIREWORKS_API_KEY="your-api-key"
Key init args ā completion params: model: Name of Fireworks model to use.
Key init args ā client params: fireworks_api_key: Fireworks API key.
See full list of supported init args and their descriptions in the params section.
Instantiate:
from langchain_fireworks import FireworksEmbeddings
model = FireworksEmbeddings(
model="nomic-ai/nomic-embed-text-v1.5"
# Use FIREWORKS_API_KEY env var or pass it in directly
# fireworks_api_key="..."
)
Embed multiple texts:
vectors = embeddings.embed_documents(["hello", "goodbye"])
# Showing only the first 3 coordinates
print(len(vectors))
print(vectors[0][:3])
2
[-0.024603435769677162, -0.007543657906353474, 0.0039630369283258915]
Embed single text:
input_text = "The meaning of life is 42"
vector = embeddings.embed_query("hello")
print(vector[:3])
[-0.024603435769677162, -0.007543657906353474, 0.0039630369283258915]