Replicate๏ƒ

pydantic model llama_index.llms.replicate.Replicate๏ƒ

Show JSON schema
{
   "title": "Replicate",
   "description": "Simple abstract base class for custom LLMs.\n\nSubclasses must implement the `__init__`, `complete`,\n    `stream_complete`, and `metadata` methods.",
   "type": "object",
   "properties": {
      "callback_manager": {
         "title": "Callback Manager"
      },
      "model": {
         "title": "Model",
         "description": "The Replicate model to use.",
         "type": "string"
      },
      "temperature": {
         "title": "Temperature",
         "description": "The temperature to use for sampling.",
         "type": "number"
      },
      "context_window": {
         "title": "Context Window",
         "description": "The maximum number of context tokens for the model.",
         "type": "integer"
      },
      "prompt_key": {
         "title": "Prompt Key",
         "description": "The key to use for the prompt in API calls.",
         "type": "string"
      },
      "additional_kwargs": {
         "title": "Additional Kwargs",
         "description": "Additional kwargs for the Replicate API.",
         "type": "object"
      }
   },
   "required": [
      "model",
      "temperature",
      "context_window",
      "prompt_key"
   ]
}

Config
  • arbitrary_types_allowed: bool = True

Fields
Validators
  • _validate_callback_manager ยป callback_manager

field additional_kwargs: Dict[str, Any] [Optional]๏ƒ

Additional kwargs for the Replicate API.

field context_window: int [Required]๏ƒ

The maximum number of context tokens for the model.

field model: str [Required]๏ƒ

The Replicate model to use.

field prompt_key: str [Required]๏ƒ

The key to use for the prompt in API calls.

field temperature: float [Required]๏ƒ

The temperature to use for sampling.

chat(messages: Sequence[ChatMessage], **kwargs: Any) Any๏ƒ

Chat endpoint for LLM.

classmethod class_name() str๏ƒ

Get the class name, used as a unique ID in serialization.

This provides a key that makes serialization robust against actual class name changes.

complete(*args: Any, **kwargs: Any) Any๏ƒ

Completion endpoint for LLM.

stream_chat(messages: Sequence[ChatMessage], **kwargs: Any) Any๏ƒ

Streaming chat endpoint for LLM.

stream_complete(*args: Any, **kwargs: Any) Any๏ƒ

Streaming completion endpoint for LLM.

property metadata: LLMMetadata๏ƒ

LLM metadata.