Deploying chains
Instantly deploy your chains to hosted API endpoints
The chains folder
Create all of your chains in a chains
folder at the root of your project. Each chain should be a separate file and export your chain
instance. The name of the file will be the ID of the chain.
For example, if you create a file called chains/pdf-qa.ts
, the chain ID will be pdf-qa
.
You use the ID for running the chain from your client side application.
Deployment
To deploy your chains, simply run relevance deploy
in your terminal. This will deploy all chains exported in the chains
folder. It’s as simple as that! You can now run your chains from your application.
Server vs. client side Deployment
When running your chain on the server, all you have to do is import your chain file. You will have complete type safety.
However, if running the SDK on the client-side, you will likely want to set your chain to publiclyTriggerable
and use the runChain
method. This will protect the internals of the chain from client side access.
In your chain definition, add:
And now in your frontend code:
Was this page helpful?