以编程方式使用文档

Fireworks AI 是一个用于运行和自定义模型的 AI 推理平台。要获取 Fireworks 提供所有模型的列表,请参阅 Fireworks 文档.

这将帮助您开始使用 LangChain 与 Fireworks 补全模型(LLM)。有关详细的文档 Fireworks 功能和配置选项,请参阅 API 参考.

概述

集成详情

本地可序列化PY 支持下载量版本
Fireworks@langchain/fireworks!NPM - 下载量!NPM - 版本

设置

要访问 Fireworks 模型,您需要创建 Fireworks 账户,获取 API 密钥,并安装 @langchain/fireworks 集成包。

凭证

前往 fireworks.ai 注册 Fireworks 并生成 API 密钥。完成此操作后,设置 FIREWORKS_API_KEY 环境变量:

如果您想获取模型调用的自动追踪功能,还可以设置您的 LangSmith API 密钥,方法如下:

# export LANGSMITH_TRACING="true"
# export LANGSMITH_API_KEY="your-api-key"

安装

LangChain Fireworks 集成位于 @langchain/fireworks package:

npm install @langchain/fireworks @langchain/core
yarn add @langchain/fireworks @langchain/core
pnpm add @langchain/fireworks @langchain/core

实例化

现在我们可以实例化模型对象并生成文本补全:

const llm = new Fireworks({
  model: "accounts/fireworks/models/llama-v3-70b-instruct",
  temperature: 0,
  maxTokens: undefined,
  timeout: undefined,
  maxRetries: 2,
  // other params...
})

调用

const inputText = "Fireworks is an AI company that "

const completion = await llm.invoke(inputText)
completion
 helps businesses automate their customer support using AI-powered chatbots. We believe that AI can help businesses provide better customer support at a lower cost. Our chatbots are designed to be highly customizable and can be integrated with various platforms such as Facebook Messenger, Slack, and more.

We are looking for a talented and motivated **Machine Learning Engineer** to join our team. As a Machine Learning Engineer at Fireworks, you will be responsible for developing and improving our AI models that power our chatbots. You will work closely with our data scientists, software engineers, and product managers to design, develop, and deploy AI models that can understand and respond to customer inquiries.

**Responsibilities:**

* Develop and improve AI models that can understand and respond to customer inquiries
* Work with data scientists to design and develop new AI models
* Collaborate with software engineers to integrate AI models with our chatbot platform
* Work with product managers to understand customer requirements and develop AI models that meet those requirements
* Develop and maintain data pipelines to support AI model development and deployment
* Develop and maintain tools to monitor and evaluate AI model performance
* Stay up-to-date with the latest developments in AI and machine learning and apply this knowledge to improve our AI models

**Requirements:**

* Bachelor's

API 参考

有关所有 Fireworks 功能和配置的详细文档,请前往 API 参考.