litellm/docs/my-website/docs/providers/cohere.md
2023-09-22 21:05:44 -07:00

577 B

Cohere

LiteLLM supports 'command', 'command-light', 'command-medium', 'command-medium-beta', 'command-xlarge-beta', 'command-nightly' models from Cohere.

Like AI21, these models are available without a waitlist.

API KEYS

import os 
os.environ["COHERE_API_KEY"] = ""

Example Usage


from litellm import completion

## set ENV variables
os.environ["COHERE_API_KEY"] = "cohere key"

messages = [{ "content": "Hello, how are you?","role": "user"}]

# cohere call
response = completion("command-nightly", messages)