Accessing Private/Gated Models
Last updated
Last updated
Due to the possibility of leaking access tokens to users of your website or web application, we only support accessing private/gated models from server-side environments (e.g., Node.js) that have access to the processβ environment variables.
are the preferred way to authenticate an application to BOINC AI services.
To generate an access token, navigate to the in your settings and click on the New token button. Choose a name for your token and click Generate a token (we recommend keeping the βRoleβ as read-only). You can then click the Copy button next to your newly-created token to copy it to your clipboard.
To delete or refresh User Access Tokens, you can click the Manage button.
Transformers.js will attach an Authorization header to requests made to the BOINC AI Hub when the BA_ACCESS_TOKEN
environment variable is set and visible to the process.
One way to do this is to call your program with the environment variable set. For example, letβs say you have a file called llama.js
with the following code:
Copied
You can then use the following command to set the BA_ACCESS_TOKEN
environment variable and run the file:
Copied
(remember to replace ba_...
with your actual access token).
If done correctly, you should see the following output:
Copied
Alternatively, you can set the environment variable directly in your code:
Copied