Konko API는 애플리케이션 개발자를 돕기 위해 설계된 완전 관리형 Web API입니다:
  1. 선택 - 애플리케이션에 적합한 오픈 소스 또는 독점 LLM 선택
  2. 구축 - 주요 애플리케이션 프레임워크와의 통합 및 완전 관리형 API를 통해 더 빠르게 애플리케이션 구축
  3. 미세 조정 - 더 작은 오픈 소스 LLM을 미세 조정하여 비용의 일부만으로 업계 최고 수준의 성능 달성
  4. 프로덕션 규모 API 배포 - Konko AI의 SOC 2 준수 멀티 클라우드 인프라를 사용하여 인프라 설정이나 관리 없이 보안, 개인정보 보호, 처리량 및 지연 시간 SLA를 충족하는 API 배포
이 예제는 LangChain을 사용하여 Konko completion models과 상호작용하는 방법을 다룹니다 이 노트북을 실행하려면 Konko API key가 필요합니다. 웹 앱에 로그인하여 모델에 액세스할 수 있는 API key를 생성하세요

Environment Variables 설정

  1. 다음에 대한 environment variables를 설정할 수 있습니다
    1. KONKO_API_KEY (필수)
    2. OPENAI_API_KEY (선택)
  2. 현재 shell session에서 export 명령을 사용하세요:
export KONKO_API_KEY={your_KONKO_API_KEY_here}
export OPENAI_API_KEY={your_OPENAI_API_KEY_here} #Optional

model 호출

Konko overview page에서 model을 찾으세요 Konko 인스턴스에서 실행 중인 model 목록을 찾는 또 다른 방법은 이 endpoint를 통하는 것입니다. 여기에서 model을 초기화할 수 있습니다:
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_))
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

Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.
I