Try our W&B Inference quickstart to get started without external API keys.
1. Install W&B Weave and create an API Key
Install weave First install the weave library:- Python
- TypeScript
2. Log a trace to a new project
To get started with tracking your first project with Weave:- Import the
weave
library - Call
weave.init('project-name')
to start tracking- When you run your code, Weave prompts you to log in with your API key if you are not yet logged in on your machine.
- To log to a specific W&B Team name, replace
project-name
withteam-name/project-name
. If you don’t specify a W&B team, your default entity is used. To find or update your default entity, refer to User Settings in the W&B Models documentation. NOTE: In automated environments, you can define the environment variableWANDB_API_KEY
with your API key to login without prompting.
- Add the
@weave.op()
decorator to the Python functions you want to track
- Python
- TypeScript
extract_dinos
function Weave will output a link to view your trace.3. Automated LLM library logging
Weave automatically tracks calls made to OpenAI, Anthropic and many more LLM libraries and logs their LLM metadata, token usage and cost. If your LLM library isn’t currently one of our integrations you can track calls to other LLMs libraries or frameworks easily by wrapping them with@weave.op()
.
4. See traces of your application in your project
Once you’ve configured your Weave in your project, Weave automatically captures the input & output data, and logs any changes made to the code.
Next steps
Now that you’ve seen Weave in action, try the W&B Inference service for easier experimentation. Get Started with W&B Inference - no need to manage multiple API keys, and free credits are included. Continue learning:- Track flows and app metadata - Dive deeper into tracing complex applications
- Build evaluations - Learn systematic model evaluation
- Explore integrations - Connect more LLM providers and frameworks
- Try the Playground to test different models