Konko API is a fully managed Web API designed 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
This example goes over how to use LangChain to interact with Konko ChatCompletion modelsTo run this notebook, you’ll need Konko API key. Sign in to our web app to create an API key to access models
Copy
Ask AI
from langchain_community.chat_models import ChatKonkofrom langchain_core.messages import HumanMessage, SystemMessage
Find a model on the Konko overview pageAnother way to find the list of models running on the Konko instance is through this endpoint.From here, we can initialize our model:
messages = [ SystemMessage(content="You are a helpful assistant."), HumanMessage(content="Explain Big Bang Theory briefly"),]chat(messages)
Copy
Ask AI
AIMessage(content=" Sure thing! The Big Bang Theory is a scientific theory that explains the origins of the universe. In short, it suggests that the universe began as an infinitely hot and dense point around 13.8 billion years ago and expanded rapidly. This expansion continues to this day, and it's what makes the universe look the way it does.\n\nHere's a brief overview of the key points:\n\n1. The universe started as a singularity, a point of infinite density and temperature.\n2. The singularity expanded rapidly, causing the universe to cool and expand.\n3. As the universe expanded, particles began to form, including protons, neutrons, and electrons.\n4. These particles eventually came together to form atoms, and later, stars and galaxies.\n5. The universe is still expanding today, and the rate of this expansion is accelerating.\n\nThat's the Big Bang Theory in a nutshell! It's a pretty mind-blowing idea when you think about it, and it's supported by a lot of scientific evidence. Do you have any other questions about it?")
Assistant
Responses are generated using AI and may contain mistakes.