프라이빗 배포 사용하기
프라이빗 배포 사용하기 (Private Deployment Usage)
Cohere의 SDK를 사용해 프라이빗 배포된 Cohere 모델에 접근하는 방법을 알아볼 거예요.
Cohere의 SDK를 사용해 프라이빗 배포된 Cohere 모델에 접근할 수 있어요.
출처: 문서
설치 (Installation)
Cohere SDK를 설치하려면 다음 4가지 언어 중에서 선택하세요.
Python
pip install -U cohere
TypeScript
npm i -s cohere-ai
Java
implementation 'com.cohere:cohere-java:1.x.x'
Go
go get github.com/cohere-ai/cohere-go/v2
시작하기 (Getting Started)
프라이빗 배포에서 Cohere의 모델을 사용하는 것과 Cohere 플랫폼에서 사용하는 것의 유일한 차이는 클라이언트를 설정하는 방법이에요. 프라이빗 배포에서는 다음 매개변수를 전달해야 해요.
api_key- 빈 값을 전달하세요base_url- 프라이빗 배포의 URL을 전달하세요
PYTHON
import cohere
co = cohere.ClientV2(
api_key="", # Leave this blank
base_url="<YOUR_DEPLOYMENT_URL>",
)
예시 사용 사례로 시작하려면 다음 퀵스타트 예시를 참조하세요.
- Text Generation (Command model)
- RAG (Command model)
- Tool Use (Command model)
- Semantic Search (Embed model)
- Reranking (Rerank model)
통합 (Integrations)
프라이빗 배포된 Cohere 모델과 함께 LangChain 라이브러리를 사용할 수 있어요. 프라이빗 배포용 LangChain 설정에 대한 자세한 내용은 LangChain 섹션을 참조하세요.