Skip to main content
Open on GitHub

Konko

与Konko相关的所有功能

Konko AI provides a fully managed API to help application developers

  1. Select the right open source or proprietary LLMs for their application
  2. Build applications faster with integrations to leading application frameworks and fully managed APIs
  3. Fine tune smaller open-source LLMs to achieve industry-leading performance at a fraction of the cost
  4. Deploy production-scale APIs that meet security, privacy, throughput, and latency SLAs without infrastructure set-up or administration using Konko AI's SOC 2 compliant, multi-cloud infrastructure

安装与设置

  1. 登录到我们的网页应用,以 创建API密钥,通过我们的端点访问模型,用于 聊天补全补全
  2. 启用 Python3.8+ 环境
  3. 安装 SDK
pip install konko
  1. 将API密钥设置为环境变量(KONKO_API_KEY,OPENAI_API_KEY)
export KONKO_API_KEY={your_KONKO_API_KEY_here}
export OPENAI_API_KEY={your_OPENAI_API_KEY_here} #Optional

请参阅 Konko 文档 获取更多详细信息。

LLM

探索可用模型:首先浏览Konko上的可用模型。每个模型都针对不同的使用场景和功能。

另一种查找在Konko实例上运行的模型列表的方法是通过此 端点

查看一个使用 示例

端点使用的示例

  • 使用 mistralai/Mistral-7B-v0.1 进行补全:

    from langchain_community.llms import Konko
    llm = Konko(max_tokens=800, model='mistralai/Mistral-7B-v0.1')
    prompt = "Generate a Product Description for Apple Iphone 15"
    response = llm.invoke(prompt)

聊天模型

查看一个使用 示例

  • 与Mistral-7B的ChatCompletion:

    from langchain_core.messages import HumanMessage
    from langchain_community.chat_models import ChatKonko
    chat_instance = ChatKonko(max_tokens=10, model = 'mistralai/mistral-7b-instruct-v0.1')
    msg = HumanMessage(content="Hi")
    chat_response = chat_instance([msg])

如需进一步帮助,请联系 support@konko.ai 或加入我们的 Discord