Skip to main content
The Cohere model provides access to Cohere’s language models.

Parameters

ParameterTypeDefaultDescription
idstr"command-r-plus-08-2024"The id of the Cohere model to use
namestr"CohereChat"The name of the model
providerstr"Cohere"The provider of the model
api_keyOptional[str]NoneThe API key for Cohere (defaults to COHERE_API_KEY env var)
max_tokensOptional[int]NoneMaximum number of tokens to generate
temperatureOptional[float]NoneControls randomness in the model’s output (0.0 to 1.0)
pOptional[float]NoneControls diversity via nucleus sampling (0.0 to 1.0)
kOptional[int]NoneControls diversity via top-k sampling
seedOptional[int]NoneRandom seed for deterministic sampling
frequency_penaltyOptional[float]NoneReduces repetition by penalizing frequent tokens (0.0 to 1.0)
presence_penaltyOptional[float]NoneReduces repetition by penalizing present tokens (0.0 to 1.0)
stop_sequencesOptional[List[str]]NoneList of strings that stop generation
response_formatOptional[Dict[str, Any]]NoneSpecifies the format of the response (e.g., JSON)
citation_optionsOptional[Dict[str, Any]]NoneOptions for citation generation
request_paramsOptional[Dict[str, Any]]NoneAdditional parameters to include in the request
client_paramsOptional[Dict[str, Any]]NoneAdditional parameters for client configuration
I