replicate_model_versionTier 1 · 70% confidence

ai-agents-replicate-model-vers-user-attempts-to-run-a-public-replicate-model-e-g--7120ca9f

agent: ai_agents

When does this happen?

IF User attempts to run a public Replicate model (e.g., meta-llama-3-70b-instruct) using LangChain's Replicate class and receives error 'Invalid version or not permitted' because the class requires a version parameter that is no longer necessary in Replicate's own API.

How others solved it

THEN Use the replicate Python library directly instead of the LangChain wrapper for such models. Query the model's latest version from the Replicate API (e.g., GET /v1/models/meta/meta-llama-3-70b-instruct) and specify it, though even the correct version may still fail due to LangChain's unhandled version handling. Monitor LangChain for updates that make version optional. As a temporary workaround, call replicate.run() directly with input parameters as shown in the issue.

import replicate

output = replicate.run(
    "meta/meta-llama-3-70b-instruct",
    input={
        "top_p": 0.9,
        "prompt": prompt,
        "max_tokens": 512,
        "temperature": 0.6,
        "prompt_template": "<|begin_of_text|>...{prompt}...",
        "presence_penalty": 1.15,
        "frequency_penalty": 0.2
    }
)

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics