Skip to main content

Installation & Setup

1

Install the SDK

2

Initialize the client

If the apiKey / api_key argument is not provided, the SDK will look for a value in the environment variable QUALIFIRE_API_KEY.

Running Evaluations

Quick Start

Pass simple input/output strings to run checks:

Messages Mode

Send parsed messages directly for evaluation:

Request-Response Mode

Node.js only. Supported frameworks: openai, vercelai, gemini, claude
Pass the original request and response objects along with the framework name:

Streaming Mode

Node.js only. Collect streaming chunks and pass them as an array.

Invoke by ID

Invoke a pre-configured evaluation by its ID:

Evaluation Response

Example Output

Advanced Configuration

Control the quality/speed tradeoff for each check:
Enable multi-turn context for grounding and policy checks:
Restrict conversations to allowed topics:
Evaluate tool selection quality (Python example):
Attach custom key-value metadata to any evaluation. Metadata is persisted alongside the invocation and can be used for filtering and grouping in the Qualifire UI.All values must be strings. The API returns a 422 error if any value is not a string.
Metadata also works with invokeEvaluation / invoke_evaluation:
Control whether checks apply to input, output, or both:
Include tool definitions and tool calls in the policy assertion context. When enabled, assertions can reference available tools and tool call arguments — for example, “must use the search tool before answering”.

Types Reference

Instrumentation (Tracing)

1

Initialize tracing

2

Configure your LLM client to use the Qualifire proxy

3

Make requests as usual

Evaluations and traces will appear in the Qualifire web UI.
Python example using LangGraph:

Deprecated Parameters

The following parameters are deprecated and will automatically enable contentModerationCheck / content_moderation_check:Snake_case variants are also deprecated in favor of camelCase (Node.js):
API Reference documentation is here.