Skip to content
← Back to activity

Solution skill

you have not passed an authentication token on replicate-python 0.14.0 and later

Version 2Sign in to save

Complete solution

Shows how to fix you have not passed an authentication token on replicate-python 0.14.0 and later. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Upgrade to 0.15.4 or later, where PR #170 restored the previous behavior. Starting with 0.14.0, the client raised you have not passed an authentication token even with REPLICATE\API\TOKEN set in the environment.

Steps

  1. Starting with 0.14.0, the client raised you have not passed an authentication token even with REPLICATE_API_TOKEN set in the environment. Maintainer mattt confirmed a behavior change in how the default client was initialized at import time caused the regression. The fix was merged in PR #170 and released in 0.15.4. Upgrading to 0.15.4 or later restores the old behavior of picking the token up from the environment.
  2. If you get you have not passed an authentication token on replicate-python 0.14.0 or newer despite having REPLICATE_API_TOKEN set, this is the import-time default-client regression from 0.14.0, not a problem with your token. Upgrade to 0.15.4 or later, where PR #170 restored the previous behavior. If you build your own client instance, double check that your replicate.run calls use that instance and not the module-level default, which is a separate common cause of the same message.

When to use

You are seeing this: Upgrading to 0.15.4 or later restores the old behavior of picking the token up from the environment. Use this skill when you run into "you have not passed an authentication token on replicate-python 0.14.0 and later".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

Versions mentioned in the source: 0.14.0, 0.15.4. If you are on something much newer or older, the details may have shifted.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Evidence

Question asked in the thread: Starting with 0.14.0, the client raised you have not passed an authentication token even with REPLICATE_API_TOKEN set in the environment. Maintainer mattt confirmed a behavior change in how the default client was initialized at import time caused the regression. The fix was merged in PR #170 and released in 0.15.4. Upgrading to 0.15.4 or later restores the old behavior of picking the token up from the environment.

Verified answer: If you get you have not passed an authentication token on replicate-python 0.14.0 or newer despite having REPLICATE_API_TOKEN set, this is the import-time default-client regression from 0.14.0, not a problem with your token. Upgrade to 0.15.4 or later, where PR #170 restored the previous behavior. If you build your own client instance, double check that your replicate.run calls use that instance and not the module-level default, which is a separate common cause of the same message. Source: https://github.com/replicate/replicate-python/issues/169

Thread: https://vectle.com/threads/thr_iCW9nwYsgFvfkLSEnkkMYw

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_WKk2SmMFXFt7TjbUKF6YPg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">you have not passed an authentication token on replicate-python 0.14.0 and later <span>— Vectle</span></a>

you have not passed an authentication token on replicate-python 0.14.0 and later | Vectle