Skip to content

Commit dec7fcc

Browse files
Update Fireworks Documentation (#1170)
## Overview Update FireworksAI integration docs to point towards serverless models and fix broken hyperlinks. ## Type of change **Type:** Update existing documentation ## Related issues/PRs ## Checklist <!-- Put an 'x' in all boxes that apply --> - [x] I have read the [contributing guidelines](README.md) - [x] I have tested my changes locally using `docs dev` - [x] All code examples have been tested and work correctly - [x] I have used **root relative** paths for internal links - [x] I have updated navigation in `src/docs.json` if needed - I have gotten approval from the relevant reviewers - (Internal team members only / optional) I have created a preview deployment using the [Create Preview Branch workflow](https://github.com/langchain-ai/docs/actions/workflows/create-preview-branch.yml) ## Additional notes <!-- Any other information that would be helpful for reviewers --> --------- Co-authored-by: Mason Daugherty <github@mdrxy.com> Co-authored-by: Mason Daugherty <mason@langchain.dev>
1 parent f187ece commit dec7fcc

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

src/oss/python/integrations/chat/fireworks.mdx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Fireworks AI is an AI inference platform to run and customize models. For a list
1212

1313
| Class | Package | Local | Serializable | [JS support](https://js.langchain.com/docs/integrations/chat/fireworks) | Downloads | Version |
1414
| :--- | :--- | :---: | :---: | :---: | :---: | :---: |
15-
| [ChatFireworks](https://python.langchain.com/api_reference/fireworks/chat_models/langchain_fireworks.chat_models.ChatFireworks.html) | [langchain-fireworks](https://python.langchain.com/api_reference/fireworks/index.html) || beta || ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-fireworks?style=flat-square&label=%20) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-fireworks?style=flat-square&label=%20) |
15+
| [`ChatFireworks`](https://docs.langchain.com/oss/python/integrations/chat/fireworks) | [`langchain-fireworks`](https://pypi.org/project/langchain-fireworks/) || beta || ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain-fireworks?style=flat-square&label=%20) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain-fireworks?style=flat-square&label=%20) |
1616

1717
### Model features
1818

@@ -61,7 +61,7 @@ Now we can instantiate our model object and generate chat completions:
6161
from langchain_fireworks import ChatFireworks
6262

6363
llm = ChatFireworks(
64-
model="accounts/fireworks/models/llama-v3-70b-instruct",
64+
model="accounts/fireworks/models/kimi-k2-instruct-0905", # Model library in: https://app.fireworks.ai/models
6565
temperature=0,
6666
max_tokens=None,
6767
timeout=None,
@@ -85,7 +85,7 @@ ai_msg
8585
```
8686

8787
```output
88-
AIMessage(content="J'adore la programmation.", response_metadata={'token_usage': {'prompt_tokens': 35, 'total_tokens': 44, 'completion_tokens': 9}, 'model_name': 'accounts/fireworks/models/llama-v3-70b-instruct', 'system_fingerprint': '', 'finish_reason': 'stop', 'logprobs': None}, id='run-df28e69a-ff30-457e-a743-06eb14d01cb0-0', usage_metadata={'input_tokens': 35, 'output_tokens': 9, 'total_tokens': 44})
88+
AIMessage(content="J'adore la programmation.", additional_kwargs={}, response_metadata={'token_usage': {'prompt_tokens': 31, 'total_tokens': 41, 'completion_tokens': 10}, 'system_fingerprint': '', 'finish_reason': 'stop', 'logprobs': None, 'model_provider': 'fireworks', 'model_name': 'accounts/fireworks/models/kimi-k2-instruct-0905'}, id='lc_run--a2bdeca3-6394-4c80-97ad-2fc8db9f54bb-0', usage_metadata={'input_tokens': 31, 'output_tokens': 10, 'total_tokens': 41})
8989
```
9090

9191
```python
@@ -98,7 +98,7 @@ J'adore la programmation.
9898

9999
## API reference
100100

101-
For detailed documentation of all ChatFireworks features and configurations head to the API reference: [python.langchain.com/api_reference/fireworks/chat_models/langchain_fireworks.chat_models.ChatFireworks.html](https://python.langchain.com/api_reference/fireworks/chat_models/langchain_fireworks.chat_models.ChatFireworks.html)
101+
For detailed documentation of all ChatFireworks features and configurations head to the [API reference](https://reference.langchain.com/python/integrations/langchain_fireworks/)
102102

103103

104104

@@ -129,14 +129,15 @@ pip install langchain-fireworks
129129
set FIREWORKS_API_KEY=your_api_key
130130
```
131131

132-
2. Set up your model using a model id. If the model is not set, the default model is `fireworks-llama-v2-7b-chat`. See the full, most up-to-date model list on [fireworks.ai](https://fireworks.ai/models).
132+
2. Set up your model using a model id. If the model is not set, the default model is `fireworks-llama-v2-7b-chat`. See the full, most up-to-date model list on [fireworks.ai](https://app.fireworks.ai/models).
133133

134134
```python
135135
import getpass
136136
import os
137+
from langchain_fireworks import ChatFireworks
137138

138139
# Initialize a Fireworks model
139-
llm = Fireworks(
140+
llm = ChatFireworks(
140141
model="accounts/fireworks/models/llama-v3p1-8b-instruct",
141142
base_url="https://api.fireworks.ai/inference/v1/completions",
142143
)

src/oss/python/integrations/llms/fireworks.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ This example goes over how to use LangChain to interact with `Fireworks` models.
1818

1919
| Class | Package | Local | Serializable | [JS support](https://js.langchain.com/v0.1/docs/integrations/llms/fireworks/) | Downloads | Version |
2020
| :--- | :--- | :---: | :---: | :---: | :---: | :---: |
21-
| [Fireworks](https://python.langchain.com/api_reference/fireworks/llms/langchain_fireworks.llms.Fireworks.html#langchain_fireworks.llms.Fireworks) | [langchain-fireworks](https://python.langchain.com/api_reference/fireworks/index.html) |||| ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain_fireworks?style=flat-square&label=%20) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain_fireworks?style=flat-square&label=%20) |
21+
| [`Fireworks`](https://python.langchain.com/api_reference/fireworks/llms/langchain_fireworks.llms.Fireworks.html#langchain_fireworks.llms.Fireworks) | [`langchain-fireworks`](https://pypi.org/project/langchain-fireworks/) |||| ![PyPI - Downloads](https://img.shields.io/pypi/dm/langchain_fireworks?style=flat-square&label=%20) | ![PyPI - Version](https://img.shields.io/pypi/v/langchain_fireworks?style=flat-square&label=%20) |
2222

2323
## Setup
2424

2525
### Credentials
2626

2727
Sign in to [Fireworks AI](http://fireworks.ai) for the an API Key to access our models, and make sure it is set as the `FIREWORKS_API_KEY` environment variable.
28-
3. Set up your model using a model id. If the model is not set, the default model is fireworks-llama-v2-7b-chat. See the full, most up-to-date model list on [fireworks.ai](https://fireworks.ai).
28+
3. Set up your model using a model id. If the model is not set, the default model is fireworks-llama-v2-7b-chat. See the full, most up-to-date model list on [fireworks.ai](https://app.fireworks.ai/models).
2929

3030
```python
3131
import getpass
@@ -54,7 +54,7 @@ from langchain_fireworks import Fireworks
5454

5555
# Initialize a Fireworks model
5656
llm = Fireworks(
57-
model="accounts/fireworks/models/llama-v3p1-8b-instruct",
57+
model="accounts/fireworks/models/llama-v3p1-8b-instruct", # Model library in: https://app.fireworks.ai/models
5858
base_url="https://api.fireworks.ai/inference/v1/completions",
5959
)
6060
```
@@ -69,7 +69,7 @@ print(output)
6969
```
7070

7171
```output
72-
If Manningville Station, Lions rookie EJ Manuel's
72+
That's an easy one. It's Aaron Rodgers. Rodgers has consistently been one
7373
```
7474

7575
### Invoking with multiple prompts
@@ -86,7 +86,7 @@ print(output.generations)
8686
```
8787

8888
```output
89-
[[Generation(text=" We're not just asking, we've done some research. We'")], [Generation(text=' The conversation is dominated by Kobe Bryant, Dwyane Wade,')]]
89+
[[Generation(text=' You could choose one of the top performers in 2016, such as Vir')], [Generation(text=' -- Keith Jackson\nA: LeBron James, Chris Paul and Kobe Bryant are the')]]
9090
```
9191

9292
### Invoking with additional parameters
@@ -145,4 +145,4 @@ for token in chain.stream({"topic": "bears"}):
145145

146146
## API reference
147147

148-
For detailed documentation of all `Fireworks` LLM features and configurations head to the API reference: [python.langchain.com/api_reference/fireworks/llms/langchain_fireworks.llms.Fireworks.html#langchain_fireworks.llms.Fireworks](https://python.langchain.com/api_reference/fireworks/llms/langchain_fireworks.llms.Fireworks.html#langchain_fireworks.llms.Fireworks)
148+
For detailed documentation of all `Fireworks` LLM features and configurations head to the [API reference](https://reference.langchain.com/python/integrations/langchain_fireworks/)

0 commit comments

Comments
 (0)