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

# LiteLLM 集成

> 使用 LangChain Python 与 LiteLLM 集成。

> [LiteLLM](https://github.com/BerriAI/litellm) 是一个简化调用 Anthropic、Azure、Huggingface、Replicate 等的库。

## 安装和设置

<CodeGroup>
  ```bash pip theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  pip install langchain-litellm
  ```

  ```bash uv theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  uv add langchain-litellm
  ```
</CodeGroup>

## 聊天模型

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
from langchain_litellm import ChatLiteLLM
```

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
from langchain_litellm import ChatLiteLLMRouter
```

有关更多详细信息，请参阅 [LiteLLM 聊天指南](/oss/python/integrations/chat/litellm)。

***

## API 参考

如需了解所有 `ChatLiteLLM` 和 `ChatLiteLLMRouter` 功能和配置的详细文档，请前往 [API 参考](https://reference.langchain.com/python/langchain-litellm)。

***

<div className="source-links">
  <Callout icon="edit">
    [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/i18n\zh-CN\oss\python\integrations\providers\litellm.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
  </Callout>

  <Callout icon="terminal-2">
    [Connect these docs](/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers.
  </Callout>
</div>
