Get started
To use Not Diamond with Weave, you must have a Not Diamond account and an API key. Create an account and generate an API key, then add your API key to your environment asNOTDIAMOND_API_KEY.

- Try the quickstart guide.
- Build a custom router with Weave and Not Diamond.
- Chat with Not Diamond to see routing in action.
Tracing
Weave integrates with Not Diamond’s Python library to automatically log API calls, so you can inspect routing decisions and provider responses alongside the rest of your Weave traces. Runweave.init() at the start of your workflow, then continue to use the routed
provider as usual:
Custom routing
For specialized use cases, you can train your own custom router on Evaluations, which lets Not Diamond route prompts according to eval performance rather than the default routing policy. Start by training a custom router. Thetrain_router call returns a preference_id that identifies
your trained router for later use:
model_select request, you can reuse your custom router to
route prompts to maximize performance and minimize cost on your evaluation data: