langchain_community.llms.together.Together¶
class langchain_community.llms.together.Together[source]¶
Bases: LLM
Wrapper around Together AI models.
To use, you’ll need an API key which you can find here:
https://api.together.xyz/settings/api-keys. This can be passed in as init param
together_api_key or set as environment variable TOGETHER_API_KEY.
Together AI API reference: https://docs.together.ai/reference/inference
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param base_url: str = 'https://api.together.xyz/inference'¶
Base inference API URL.
param cache: Optional[bool] = None¶
param callback_manager: Optional[BaseCallbackManager] = None¶
param callbacks: Callbacks = None¶
param logprobs: Optional[int] = None¶
An integer that specifies how many top token log probabilities are included in
the response for each token generation step.
param max_tokens: Optional[int] = None¶
The maximum number of tokens to generate.
param metadata: Optional[Dict[str, Any]] = None¶
Metadata to add to the run trace.
param model: str [Required]¶
Model name. Available models listed here:
https://docs.together.ai/docs/inference-models
param repetition_penalty: Optional[float] = None¶
A number that controls the diversity of generated text by reducing the
likelihood of repeated sequences. Higher values decrease repetition.
param tags: Optional[List[str]] = None¶
Tags to add to the run trace.
param temperature: Optional[float] = None¶
Model temperature.
param together_api_key: pydantic.types.SecretStr [Required]¶