Konko
与Konko相关的所有功能
Konko AI provides a fully managed API to help application developers
- Select the right open source or proprietary LLMs for their application
- Build applications faster with integrations to leading application frameworks and fully managed APIs
- Fine tune smaller open-source LLMs to achieve industry-leading performance at a fraction of the cost
- 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
安装与设置
pip install konko
- 将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。