FAQ
Frequently asked questions about Basalt SDK and platform.
How do I authenticate with Basalt?
How do I authenticate with Basalt?
To authenticate with Basalt, you’ll need an API key which you can generate from your Basalt dashboard. Then initialize the SDK with your API key:
Keep your API key secure and avoid hardcoding it in your application. Use environment variables or a secure secret manager in production environments.
What languages does Basalt SDK support?
What languages does Basalt SDK support?
The Basalt SDK is available for both TypeScript/JavaScript and Python. Both versions provide the same core functionality with language-specific implementations. Choose the one that best fits your tech stack.
All examples in our documentation include code snippets for both languages.
How do I manage prompts with Basalt?
How do I manage prompts with Basalt?
Basalt provides a complete prompt management system. You can create and edit prompts in the Basalt web application, then retrieve them in your code using the SDK:
Prompts can be versioned, tagged, and include variables that you can replace at runtime.
What is the difference between basic monitoring and tracing?
What is the difference between basic monitoring and tracing?
Basic monitoring is the simplest way to track individual AI interactions, automatically enabled when you use basalt.prompt.get()
. It’s ideal for simple workflows that use a single prompt to generate a response.
Tracing is a more comprehensive system for monitoring complex workflows with multiple steps, branching logic, and/or parallel processes. It gives you deeper visibility into each step of your AI application and requires more explicit code to create traces, logs, and generations.
Use basic monitoring for simple use cases and tracing for complex workflows where you need to understand what happens at each step.
How do experiments work in Basalt?
How do experiments work in Basalt?
Experiments allow you to group multiple traces together for comparison. When you create an experiment and attach traces to it, those traces are collected for analysis rather than sent to regular monitoring.
This is useful for A/B testing different versions of your workflows, evaluating prompt changes, or optimizing model parameters.
You can then view and analyze the results in the Basalt application.
How does evaluation work in Basalt?
How does evaluation work in Basalt?
Evaluators are tools that automatically assess the quality of your AI outputs based on specific criteria. You can add evaluators to traces or generations:
Evaluators are run at sample rates you can configure, except in experiments where they always run at 100% to ensure complete data for comparison. You can create custom evaluators in the Basalt application.
What is the purpose of caching in the SDK?
What is the purpose of caching in the SDK?
The SDK includes a built-in caching system with two main components:
- API cache: Ensures high availability of prompts even during service disruptions
- Local SDK cache: Reduces network requests by storing recently retrieved prompts
By default, caching is enabled with a 5-minute duration. You can disable it for specific requests:
Best practice is to keep caching enabled in production for performance and disable it in development to always get the latest versions.
How do I monitor a complex workflow with multiple steps?
How do I monitor a complex workflow with multiple steps?
For complex workflows, use Basalt’s tracing system:
-
Create a main trace for the overall workflow:
-
Create logs for each major step:
-
Create generations for AI interactions:
-
End each component when complete:
This creates a hierarchical structure that represents your workflow.
How should I handle errors with the SDK?
How should I handle errors with the SDK?
The Basalt SDK uses a consistent error handling pattern. All methods return an object with value
and error
properties:
For traces, make sure to end them even when errors occur:
How do I associate user information with traces?
How do I associate user information with traces?
You can associate user and organization information with traces for better analytics:
This allows you to filter and analyze traces by user or organization in the Basalt dashboard.
How do I use prompt versions and tags?
How do I use prompt versions and tags?
How can I improve performance with the SDK?
How can I improve performance with the SDK?
To optimize performance:
- Keep caching enabled in production (the default)
- Use appropriate evaluation sample rates to balance insight with cost
- Batch similar operations where possible
- End traces and generations promptly to ensure data is sent efficiently
- Add detailed metadata to help with filtering and analysis
- Structure your traces hierarchically to represent your workflow accurately
When will the Datasets feature be available?
When will the Datasets feature be available?
The Datasets feature is currently in development and will be available soon. This feature will allow you to:
- Store collections of inputs and expected outputs
- Create standardized test sets for evaluation
- Run experiments against consistent data
- Compare different approaches using the same baseline
Stay tuned for announcements about the release date.