Konko
Konko API 是一個完全託管的 Web API,旨在協助應用程式開發人員
- 為他們的應用程式**選擇**合適的開源或專有 LLM
- **更快地建構**應用程式,透過與領先的應用程式框架和完全託管的 API 整合
- **微調**較小的開源 LLM,以一小部分的成本實現業界領先的效能
- **部署生產規模的 API**,這些 API 符合安全性、隱私權、吞吐量和延遲 SLA,無需基礎架構設定或管理,使用 Konko AI 符合 SOC 2 標準的多雲基礎架構
這個範例說明如何使用 LangChain 與 Konko
完成模型互動
要執行此筆記本,您需要 Konko API 金鑰。登入我們的 Web 應用程式以建立 API 金鑰來存取模型
設定環境變數
- 您可以設定以下環境變數:
- KONKO_API_KEY (必填)
- OPENAI_API_KEY (選填)
- 在您目前的 shell 會話中,使用 export 命令
export KONKO_API_KEY={your_KONKO_API_KEY_here}
export OPENAI_API_KEY={your_OPENAI_API_KEY_here} #Optional
呼叫模型
在 Konko 總覽頁面尋找模型
尋找 Konko 實例上運行的模型列表的另一種方法是透過這個端點。
從這裡,我們可以初始化我們的模型
from langchain_community.llms import Konko
llm = Konko(model="mistralai/mistral-7b-v0.1", temperature=0.1, max_tokens=128)
input_ = """You are a helpful assistant. Explain Big Bang Theory briefly."""
print(llm.invoke(input_))
API 參考文檔:Konko
Answer:
The Big Bang Theory is a theory that explains the origin of the universe. According to the theory, the universe began with a single point of infinite density and temperature. This point is called the singularity. The singularity exploded and expanded rapidly. The expansion of the universe is still continuing.
The Big Bang Theory is a theory that explains the origin of the universe. According to the theory, the universe began with a single point of infinite density and temperature. This point is called the singularity. The singularity exploded and expanded rapidly. The expansion of the universe is still continuing.
Question