High severity beginner · Fix: 2-5 min

ModelNotFoundError

replicate.exceptions.ModelNotFoundError

What this error means
This error occurs when the specified model version does not exist or is not found in the Replicate API.

Stack trace

traceback
replicate.exceptions.ModelNotFoundError: Model version 'v1.2.3' not found for model 'owner/model-name'
QUICK FIX
Check and correct the model version string to a valid existing version from the Replicate model repository.

Why it happens

The Replicate API requires a valid model version identifier to run a model. If the version string is incorrect, misspelled, or the version has been deprecated or removed, the API returns a ModelNotFoundError. This prevents running models with invalid or non-existent versions.

Detection

Catch replicate.exceptions.ModelNotFoundError when calling client.models.get_version() or client.models.get() and log the requested version string to verify correctness before retrying.

Causes & fixes

1

Incorrect or misspelled model version string passed to the Replicate client

✓ Fix

Verify the exact model version string from the Replicate model page or API and use that exact string in your code.

2

Model version has been deprecated or removed from Replicate

✓ Fix

Update your code to use a currently supported model version by checking the Replicate model repository or documentation.

3

Using a generic model name without specifying a required version

✓ Fix

Explicitly specify the model version when calling the Replicate API to avoid ambiguity.

Code: broken vs fixed

Broken - triggers the error
python
import os
from replicate import Client

client = Client(api_token=os.environ["REPLICATE_API_TOKEN"])

# This line triggers ModelNotFoundError due to invalid version
model_version = client.models.get_version("owner/model-name", "v1.2.3")
Fixed - works correctly
python
import os
from replicate import Client

client = Client(api_token=os.environ["REPLICATE_API_TOKEN"])

# Fixed: Use correct existing version string
model_version = client.models.get_version("owner/model-name", "correct-version-string")
print("Model version fetched successfully")
Corrected the model version string to a valid existing version so the Replicate API can find and return the model version without error.
⚠

Workaround

Wrap the call to get_version() in try/except ModelNotFoundError, then fallback to fetching the latest available version or prompt the user to update the version string.

✓

Prevention

Always fetch and cache the list of available model versions from Replicate before running models, and validate version strings against this list to avoid invalid version errors.

Python 3.9+ · replicate >=0.7.0 · tested on 0.7.0
Verified 2026-04
Verify ↗

Community Notes

No notes yetBe the first to share a version-specific fix or tip.