Skip to main content

Llama.cpp

llama.cpp python 库是 @ggerganov 的简单 Python 绑定 llama.cpp

该包提供:

  • 通过 ctypes 接口访问 C API 的低级访问。
  • 用于文本补全的高级 Python API
    • 类似于 OpenAI 的 API
    • LangChain 兼容性
    • LlamaIndex 兼容性
  • OpenAI 兼容的网络服务器
    • 本地 Copilot 替代品
    • 函数调用支持
    • 视觉 API 支持
    • 多模型

安装与设置

  • 安装 Python 包
    pip install llama-cpp-python
  • Download one of the supported models and convert them to the llama.cpp format per the instructions

Chat models

See a usage example.

from langchain_community.chat_models import ChatLlamaCpp

大型语言模型

查看使用示例

from langchain_community.llms import LlamaCpp

嵌入模型

查看使用示例

from langchain_community.embeddings import LlamaCppEmbeddings

Was this page helpful?


You can also leave detailed feedback on GitHub.

扫我,入群扫我,找书