> ## Documentation Index
> Fetch the complete documentation index at: https://langchain-docs-zh.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Pipeshift 集成

> 使用 LangChain Python 集成 Pipeshift。

> [Pipeshift](https://pipeshift.com) 是一个用于开源大语言模型的微调和推理平台

* 您可以提供自己的数据集。微调多个大语言模型。一键开始推理，并观察它们扩展到数百万级别。

## 安装和设置

* 安装 Pipeshift 集成包。

  ```bash theme={null}
  pip install langchain-pipeshift
  ```

* 通过在 [Pipeshift](https://pipeshift.com) 注册获取您的 Pipeshift API 密钥。

### 认证

您可以通过以下任何一种方式使用您的 Pipeshift API 密钥进行认证：

1. 将 API 密钥添加到环境变量 `PIPESHIFT_API_KEY`。

   ```python theme={null}
   os.environ["PIPESHIFT_API_KEY"] = "<your_api_key>"
   ```

2. 通过将 `api_key` 传递给 pipeshift 大语言模型模块或对话模块

   ```python theme={null}
   llm = Pipeshift(api_key="<your_api_key>", model="meta-llama/Meta-Llama-3.1-8B-Instruct", max_tokens=512)

                       OR

   chat = ChatPipeshift(api_key="<your_api_key>", model="meta-llama/Meta-Llama-3.1-8B-Instruct", max_tokens=512)
   ```

## 对话模型

查看 [示例](https://github.com/pipeshift-org/langchain-pipeshift)。

```python theme={null}
from langchain_pipeshift import ChatPipeshift
```

## 大语言模型

查看 [示例](https://langchain-docs-zh.mintlify.site/langchain/oss/python/integrations/llms/pipeshift.md)。

```python theme={null}
from langchain_pipeshift import Pipeshift
```

***

> 官方原文：[src/oss/python/integrations/providers/pipeshift.mdx](https://github.com/langchain-ai/docs/blob/main/src/oss/python/integrations/providers/pipeshift.mdx) · 非官方翻译，译文由 AI 生成，以英文原文为准。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.