Convert Figma logo to code with AI

Giskard-AI logogiskard-oss

🐢 Open-Source Evaluation & Testing library for LLM Agents

5,507
484
5,507
70

Top Related Projects

Responsible AI Toolbox is a suite of tools providing model and data exploration and assessment user interfaces and libraries that enable a better understanding of AI systems. These interfaces and libraries empower developers and stakeholders of AI systems to develop and monitor AI more responsibly, and take better data-driven actions.

2,838

A comprehensive set of fairness metrics for datasets and machine learning models, explanations for these metrics, and algorithms to mitigate bias in datasets and models.

A Python package to assess and improve fairness of machine learning models.

Fit interpretable models. Explain blackbox machine learning.

25,406

A game theoretic approach to explain the output of any machine learning model.

1,786

Interpretability and explainability of data and machine learning models

Quick Overview

Giskard-AI/giskard-oss is an open-source AI testing framework designed to detect and prevent AI failures in production. It provides a comprehensive suite of tools for testing, monitoring, and debugging machine learning models, with a focus on ensuring model reliability, fairness, and performance across various scenarios.

Pros

  • Comprehensive testing suite for AI models, covering various aspects such as performance, fairness, and robustness
  • User-friendly interface for creating and managing tests, making it accessible to both technical and non-technical users
  • Integrates well with popular machine learning frameworks and workflows
  • Supports multiple programming languages and environments

Cons

  • May require a learning curve for users new to AI testing concepts
  • Documentation could be more extensive for advanced use cases
  • Limited community support compared to more established testing frameworks
  • Some features may be better suited for enterprise-level projects, potentially overwhelming for smaller teams

Code Examples

  1. Creating a simple test case:
from giskard import test

@test
def test_model_accuracy(model, dataset):
    predictions = model.predict(dataset)
    accuracy = (predictions == dataset.target).mean()
    assert accuracy > 0.8, "Model accuracy is below 80%"
  1. Testing for fairness across protected groups:
from giskard import test, FairnessMetric

@test
def test_gender_fairness(model, dataset):
    fairness = FairnessMetric(protected_feature='gender')
    score = fairness.compute(model, dataset)
    assert score > 0.9, "Gender bias detected in model predictions"
  1. Generating adversarial examples:
from giskard import test, AdversarialGenerator

@test
def test_adversarial_robustness(model, dataset):
    generator = AdversarialGenerator()
    adversarial_examples = generator.generate(model, dataset)
    robustness_score = model.evaluate(adversarial_examples)
    assert robustness_score > 0.7, "Model is not robust against adversarial attacks"

Getting Started

To get started with Giskard, follow these steps:

  1. Install Giskard:
pip install giskard
  1. Import Giskard and set up your model and dataset:
from giskard import Model, Dataset

model = Model(prediction_function=your_model_function)
dataset = Dataset(X=your_features, y=your_labels)
  1. Create and run tests:
from giskard import test, Suite

@test
def your_custom_test(model, dataset):
    # Your test logic here
    pass

suite = Suite(tests=[your_custom_test])
results = suite.run(model, dataset)
print(results.summary())

Competitor Comparisons

Responsible AI Toolbox is a suite of tools providing model and data exploration and assessment user interfaces and libraries that enable a better understanding of AI systems. These interfaces and libraries empower developers and stakeholders of AI systems to develop and monitor AI more responsibly, and take better data-driven actions.

Pros of Responsible AI Toolbox

  • Comprehensive suite of tools for responsible AI development, including interpretability, fairness, and error analysis
  • Extensive documentation and tutorials for easy adoption
  • Backed by Microsoft, ensuring long-term support and updates

Cons of Responsible AI Toolbox

  • Steeper learning curve due to the wide range of features
  • Primarily focused on tabular data and traditional machine learning models
  • Less emphasis on real-time monitoring and production-ready features

Code Comparison

Responsible AI Toolbox:

from raiwidgets import ExplanationDashboard

ExplanationDashboard(global_explanation, model, dataset, true_y, features)

Giskard:

from giskard import scan

scan(model, dataset, features)

The Responsible AI Toolbox code snippet demonstrates the use of an explanation dashboard, while Giskard's code shows a simpler scanning function for model analysis. Giskard's approach appears more straightforward, but the Responsible AI Toolbox offers more detailed visualization options.

2,838

A comprehensive set of fairness metrics for datasets and machine learning models, explanations for these metrics, and algorithms to mitigate bias in datasets and models.

Pros of AIF360

  • Comprehensive suite of fairness metrics and algorithms
  • Well-established project with extensive documentation
  • Supports multiple programming languages (Python, R, and NodeJS)

Cons of AIF360

  • Steeper learning curve due to its extensive feature set
  • Less focus on model monitoring and debugging
  • Primarily designed for offline analysis rather than real-time monitoring

Code Comparison

AIF360:

from aif360.datasets import BinaryLabelDataset
from aif360.metrics import BinaryLabelDatasetMetric

dataset = BinaryLabelDataset(...)
metric = BinaryLabelDatasetMetric(dataset, unprivileged_groups, privileged_groups)

Giskard:

from giskard import Dataset, Model, scan

dataset = Dataset(...)
model = Model(...)
scan_results = scan(model, dataset)

Summary

AIF360 offers a comprehensive suite of fairness metrics and algorithms, making it suitable for in-depth fairness analysis across multiple programming languages. However, it has a steeper learning curve and is primarily designed for offline analysis.

Giskard, on the other hand, focuses on model monitoring and debugging, providing a more user-friendly interface for real-time analysis. It may be more suitable for users looking for quick insights and continuous monitoring of their ML models.

A Python package to assess and improve fairness of machine learning models.

Pros of fairlearn

  • More established project with a larger community and longer history
  • Focuses specifically on fairness metrics and mitigation techniques
  • Integrates well with popular machine learning libraries like scikit-learn

Cons of fairlearn

  • Limited scope compared to Giskard's broader testing capabilities
  • Less emphasis on model debugging and error analysis
  • May require more manual configuration for complex fairness scenarios

Code Comparison

fairlearn example:

from fairlearn.metrics import demographic_parity_difference
from fairlearn.reductions import DemographicParity

dp = DemographicParity()
mitigator = dp.fit(X, y, sensitive_features=A)
y_pred_mitigated = mitigator.predict(X)

Giskard example:

from giskard import scan, Dataset

dataset = Dataset(df, target="target")
scan_results = scan(model, dataset)
fairness_issues = scan_results.fairness_issues

While fairlearn focuses on specific fairness metrics and mitigation techniques, Giskard offers a more comprehensive approach to model testing and debugging, including fairness analysis as part of a broader suite of tests. fairlearn may be more suitable for projects with a strong focus on fairness, while Giskard provides a more general-purpose testing framework for machine learning models.

Fit interpretable models. Explain blackbox machine learning.

Pros of Interpret

  • More comprehensive and established library for interpretable machine learning
  • Supports a wider range of interpretation techniques and algorithms
  • Better documentation and examples for various use cases

Cons of Interpret

  • Steeper learning curve due to its extensive feature set
  • May be overkill for simpler interpretation tasks
  • Less focus on testing and quality assurance aspects of ML models

Code Comparison

Interpret:

from interpret import set_visualize_provider
from interpret.provider import InlineProvider
set_visualize_provider(InlineProvider())

from interpret.glassbox import ExplainableBoostingClassifier
ebm = ExplainableBoostingClassifier()
ebm.fit(X_train, y_train)

ebm_global = ebm.explain_global()
ebm_global.visualize()

Giskard:

from giskard import Model, Dataset

model = Model(predict_function, model_type="classification")
dataset = Dataset(X_test, y_test, name="test_dataset")

giskard_report = model.scan(dataset)
giskard_report.display()

Both libraries offer tools for model interpretation, but Interpret provides a more comprehensive set of techniques, while Giskard focuses on testing and quality assurance aspects of ML models.

25,406

A game theoretic approach to explain the output of any machine learning model.

Pros of SHAP

  • More established and widely adopted in the data science community
  • Focuses specifically on model interpretability and feature importance
  • Supports a broader range of machine learning models and frameworks

Cons of SHAP

  • Limited to model explanation and doesn't offer comprehensive testing features
  • May require more manual effort to integrate into existing ML pipelines
  • Less emphasis on bias detection and fairness assessment

Code Comparison

SHAP example:

import shap
explainer = shap.TreeExplainer(model)
shap_values = explainer.shap_values(X)
shap.summary_plot(shap_values, X)

Giskard example:

import giskard
test_suite = giskard.scan(model, dataset)
results = test_suite.run()
giskard.plot.performance(results)

SHAP focuses on generating and visualizing feature importance, while Giskard provides a more comprehensive testing suite for ML models, including performance, robustness, and fairness assessments. SHAP is better suited for in-depth model interpretability, whereas Giskard offers a broader range of testing capabilities for ML pipelines.

1,786

Interpretability and explainability of data and machine learning models

Pros of AIX360

  • More comprehensive set of explainability algorithms, including LIME, SHAP, and ProtoDash
  • Stronger focus on interpretability for various AI models, not just testing
  • Better documentation and tutorials for understanding complex AI concepts

Cons of AIX360

  • Less emphasis on continuous testing and monitoring of AI systems
  • Fewer features for detecting data drift and model performance issues
  • Not as user-friendly for non-technical users or those new to AI explainability

Code Comparison

AIX360:

from aix360.algorithms.contrastive import CEMExplainer
explainer = CEMExplainer(model)
explanation = explainer.explain_instance(x, num_features=5)

Giskard:

from giskard import Model, Dataset
model = Model(predict_fn)
dataset = Dataset(df)
scan_results = model.scan(dataset)

The AIX360 code focuses on generating explanations for specific instances, while Giskard's code is geared towards scanning entire datasets for potential issues.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

giskardlogo giskardlogo

Evals, Red Teaming and Test Generation for Agentic Systems

Modular, Lightweight, Dynamic and Async-first

GitHub release License Downloads CI Giskard on Discord

DocsWebsiteCommunity


[!IMPORTANT] Giskard v3 is a fresh rewrite designed for dynamic, multi-turn testing of AI agents. This release drops heavy dependencies for better efficiency while introducing a more powerful AI vulnerability scanner and enhanced RAG evaluation capabilities. For now, the vulnerability scanner and RAG evaluation still rely on Giskard v2. Giskard v2 remains available but is no longer actively maintained. Follow progress → Read the v3 Announcement · Roadmap

Install

pip install giskard

Requires Python 3.12+.

Telemetry: Libraries built on giskard-core (including giskard-checks) may send optional, aggregated usage analytics to help improve the product. No prompts, model outputs, or scenario text are included. See what is collected and how to opt out.


Giskard is an open-source Python library for testing and evaluating agentic systems. The v3 architecture is a modular set of focused packages — each carrying only the dependencies it needs — built from scratch to wrap anything: an LLM, a black-box agent, or a multi-step pipeline.

StatusPackageDescription
✅ Betagiskard-checksTesting & evaluation — scenario API, built-in checks, LLM-as-judge
✅ Betagiskard-scanAgent vulnerability scanner — red teaming, prompt injection, data leakage (successor of v2 Scan)
📋 Plannedgiskard-ragRAG evaluation & synthetic data generation (successor of v2 RAGET)

Giskard Checks — create and apply evals for testing agents

pip install giskard-checks

Giskard Checks is a lightweight library for creating evaluations (evals) that test LLM-based systems — from simple assertions to LLM-as-judge assessments. Unlike traditional unit tests, evals are designed for non-deterministic outputs where the same input can produce different valid responses.

Use Giskard Checks to:

  • Catch regressions — verify your system still behaves correctly after changes
  • Validate RAG quality — check if answers are grounded in retrieved context
  • Enforce safety rules — ensure outputs conform to your content policies
  • Evaluate multi-turn agents — test full conversations, not just single exchanges

Built-in evals include string matching, comparisons, regex, semantic similarity, and LLM-as-judge checks (Groundedness, Conformity, LLMJudge).

Quickstart

from openai import OpenAI
from giskard.checks import Scenario, Groundedness

client = OpenAI()

def get_answer(inputs: str) -> str:
    response = client.chat.completions.create(
        model="gpt-5-mini",
        messages=[{"role": "user", "content": inputs}],
    )
    return response.choices[0].message.content

scenario = (
    Scenario("test_dynamic_output")
    .interact(
        inputs="What is the capital of France?",
        outputs=get_answer,
    )
    .check(
        Groundedness(
            name="answer is grounded",
            context="France is a country in Western Europe. Its capital is Paris.",
        )
    )
)

result = await scenario.run()
result.print_report()

The run() method is async. In a script, wrap it with asyncio.run(). See the full docs for Suites, LLMJudge, multi-turn scenarios, and more.


Giskard Scan — vulnerability scanner for AI agents

pip install giskard-scan

Giskard Scan is the red-teaming and vulnerability scanning layer for agentic systems. It generates adversarial test suites automatically from a plain-language description of your agent, covering prompt injection, harmful content, stereotypes, misinformation, and more.

Use Giskard Scan to:

  • Red-team your agent — automatically generate adversarial inputs across OWASP LLM Top-10 threat categories
  • Run prompt-injection probes — built-in dataset of injection payloads ready to use
  • Extend with custom generators — pass your own ScenarioGenerator instances to generate_suite, or register them on vulnerability_suite_generator_registry

Quickstart

import asyncio
from giskard.scan import vulnerability_scan

async def main():
    await vulnerability_scan(
        target=my_agent,
        description="A customer support chatbot for an e-commerce platform.",
        languages=["en"],
    )

asyncio.run(main())

Looking for Giskard v2?

Giskard v2 included Scan (automatic vulnerability detection) and RAGET (RAG evaluation test set generation) for both ML models and LLM applications. These features are not available in v3.

pip install "giskard[llm]>2,<3"

Scan — automatically detect performance, bias & security issues

Wrap your model and run the scan:

import giskard
import pandas as pd

# Replace my_llm_chain with your actual LLM chain or model inference logic
def model_predict(df: pd.DataFrame):
    """The function takes a DataFrame and must return a list of outputs (one per row)."""
    return [my_llm_chain.run({"query": question}) for question in df["question"]]

giskard_model = giskard.Model(
    model=model_predict,
    model_type="text_generation",
    name="My LLM Application",
    description="A question answering assistant",
    feature_names=["question"],
)

scan_results = giskard.scan(giskard_model)
display(scan_results)

Scan Example

RAGET — generate evaluation datasets for RAG applications

Automatically generate questions, reference answers, and context from your knowledge base:

import pandas as pd
from giskard.rag import generate_testset, KnowledgeBase

# Load your knowledge base documents
df = pd.read_csv("path/to/your/knowledge_base.csv")
knowledge_base = KnowledgeBase.from_pandas(df, columns=["column_1", "column_2"])

testset = generate_testset(
    knowledge_base,
    num_questions=60,
    language='en',
    agent_description="A customer support chatbot for company X",
)

RAGET Example

Full v2 docs

👋 Community

We welcome contributions from the AI community! Read this guide to get started, and join our thriving community on Discord.

Follow the progress and share feedback: v3 Announcement · Roadmap

🌟 Leave us a star, it helps the project to get discovered by others and keeps us motivated to build awesome open-source tools! 🌟

❤️ If you find our work useful, please consider sponsoring us on GitHub. With a monthly sponsoring, you can get a sponsor badge, display your company in this readme, and get your bug reports prioritized. We also offer one-time sponsoring if you want us to get involved in a consulting project, run a workshop, or give a talk at your company.