Skip to main content
When building complex LLM workflows you may need to prompt different models according to accuracy, cost, or call latency. You can use Not Diamond to route prompts in these workflows to the right model for your needs, helping maximize accuracy while saving on model costs.

Getting started

Make sure you have created an account and generated an API key, then add your API key to your env as NOTDIAMOND_API_KEY. Create an API key From here, you can

Tracing

Weave integrates with Not Diamond’s Python library to automatically log API calls. You only need to run weave.init() at the start of your workflow, then continue using the routed provider as usual:

Custom routing

You can also train your own custom router on Evaluations, allowing Not Diamond to route prompts according to eval performance for specialized use cases. Start by training a custom router:
By reusing this preference ID in any model_select request, you can route your prompts to maximize performance and minimize cost on your evaluation data:

Additional support

Visit the docs or send us a message for further support.