Setup
Ensure that you have an OpenGradient API key in order to access the OpenGradient network. If you already have an API key, simply set the environment variable:Installation
This toolkit lives in thelangchain-opengradient package:
Instantiation
Now we can instantiate our toolkit with the API key from before.Build your own tools
The OpenGradientToolkit offers two main methods for creating custom tools:1. Create a tool to run ML models
You can create tools that leverage ML models deployed on the OpenGradient model hub. User-created models can be uploaded, inferenced, and shared to the model hub through the OpenGradient SDK.2. Create a tool to read workflow results
Read workflows are scheduled inferences that regularly run models stored on smart-contracts with live oracle data. More information on these can be found here. You can create tools that read results from workflow smart contracts:Tools
Use the built inget_tools() method to view a list of the available tools within the OpenGradient toolkit.
Use within an agent
Here’s how to use your OpenGradient tools with a LangChain agent:API reference
See the Github page for more detail.Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.