Skip to main content
Glama

Chat with an LLM via Replicate

replicate_chat

Generate free-form text with hosted LLMs for Q&A, coding, summarization, or translation by sending a prompt and optional system instructions.

Instructions

Run a large language model hosted on Replicate. Use this for free-form text generation, Q&A, code writing, summarisation, translation — anything where the input is text and the output is text.

Args:

  • prompt (string): User message.

  • model (string, default "llama-3-70b"): Curated key (llama-3.1-405b, llama-3-70b, llama-3-8b, mistral-7b, mixtral-8x7b, deepseek-r1) or "owner/name".

  • system_prompt (string, optional): Persona / instructions.

  • max_tokens (1-8192, optional): Generation limit.

  • temperature (0-2, optional): Sampling temperature.

  • extra_input (object, optional): Model-specific extras (top_p, top_k, frequency_penalty, etc.).

  • download (boolean, default false): No file outputs; leave false.

  • timeout_ms (5000-1800000, optional): Default 300000.

Returns: PredictionResult with text_output[0] containing the model's reply (later entries are raw streamed segments if applicable).

Examples:

  • prompt="Explain quantum entanglement in two sentences.", model="llama-3-70b"

  • prompt="Write a Python function to compute Levenshtein distance.", model="mistral-large", system_prompt="You are an expert software engineer."

Input Schema

NameRequiredDescriptionDefault
modelNoLLM identifier. Curated keys: llama-3.1-405b, llama-3-70b, llama-3-8b, mistral-7b, mixtral-8x7b, deepseek-r1. Or full Replicate "owner/name[:version]".llama-3-70b
promptYesUser message / prompt for the LLM.
downloadNoLLM output is text — default false (no file to download).
max_tokensNoMax tokens to generate. Default model-dependent.
timeout_msNoMax ms to wait for the prediction. If exceeded, returns the prediction ID so you can poll via replicate_get_prediction. Default: 300000 (5min).
extra_inputNoAdditional model-specific inputs.
temperatureNoSampling temperature 0.0–2.0. Lower = more deterministic.
system_promptNoOptional system prompt to set persona / instructions.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv3.3.1
    • addedInput schema / properties / extra_input / propertyNames
      Added value: +{
      +  "type": "string"
      +}
  2. First observedv3.2.3

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnly=false, openWorld=true, idempotent=false, destructive=false, so the description is not the sole carrier of safety info. It still adds real behavioral context the annotations cannot: the timeout fallback returns a prediction ID to poll via replicate_get_prediction, and download should stay false since output is text. It omits cost/billing implications, which would have made it a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the one-line purpose and the text-to-text scope before the parameter list, and every section is labelled. The Args block largely restates schema descriptions, which is mild redundancy rather than bloat, but it costs a point against tighter prose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description still specifies the return shape (PredictionResult with text_output[0]) and explains where later entries come from and how the timeout path is recovered. Combined with 8 parameters and nested extra_input, this covers everything an agent needs to invoke and interpret the call.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3, and the description goes beyond it by listing the curated model keys, restating defaults and ranges, and giving per-parameter intent (extra_input for top_p/top_k/penalties). The examples showing system_prompt in context add practical meaning the schema alone does not convey.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Run a large language model hosted on Replicate') and immediately scopes it to text-in/text-out tasks, which cleanly separates it from the image, video, audio, vision, and embedding siblings. An agent can classify a request without inspecting any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Enumerates concrete use cases (free-form generation, Q&A, code, summarisation, translation) with two worked examples, which is strong positive guidance. It does not explicitly say when to prefer a sibling such as replicate_run_model or replicate_vision instead, so the routing is implied rather than stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.