跳到主要内容
CTranslate2 是一个 C++ 和 Python 库,用于 Transformer 模型的高效推理。 该项目实现了一个自定义运行时,应用了权重量化、层融合、批处理重排序等多种性能优化技术,以加速 Transformer 模型在 CPU 和 GPU 上的运行并减少内存使用。 项目仓库中包含了完整的功能列表和支持的模型。要开始使用,请查看官方的快速入门指南

安装和设置

安装 Python 包
pip install ctranslate2

LLMs

查看使用示例
from langchain_community.llms import CTranslate2

以编程方式连接这些文档到 Claude、VSCode 等,通过 MCP 获取实时答案。
© . This site is unofficial and not affiliated with LangChain, Inc.