Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pair-code/farsight

In situ interactive widgets for responsible AI 🌱
https://github.com/pair-code/farsight

ai ai-safety chatgpt chrome-extension gemini gemini-pro gpt-4 jupyter-notebook llm notebook responsible-ai

Last synced: about 2 months ago
JSON representation

In situ interactive widgets for responsible AI 🌱

Awesome Lists containing this project

README

        

Farsight Farsight logo.

[![Github Actions Status](https://github.com/PAIR-code/farsight/workflows/build/badge.svg)](https://github.com/PAIR-code/farsight/actions/workflows/build.yml)
[![license](https://img.shields.io/badge/License-Apache_2-blue)](https://github.com/PAIR-code/farsight/blob/main/LICENSE)
[![npm](https://img.shields.io/npm/v/@xiaohk/farsight?color=orange)](https://www.npmjs.com/package/@xiaohk/farsight)
[![pypi](https://img.shields.io/pypi/v/farsight?color=yellow)](https://pypi.org/project/farsight/)
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1aTIW3tRX1BRcNMCg8bRKktpZxRXtMF3-?usp=sharing)
[![arxiv badge](https://img.shields.io/badge/arXiv-2402.15350-red)](https://arxiv.org/abs/2402.15350)
[![10.1145/3613904.3642335](https://img.shields.io/badge/DOI-10.1145/3613904.3642335-blue)](https://doi.org/10.1145/3613904.3642335)

In situ interactive widgets for responsible AI 🌱






🚀 Farsight Demo
📺 Demo Video

📖 Research Paper

## What is Farsight?

Farsight is a collection of _in situ_ interactive widgets that help large language model (LLM) prompt creators to envision potential harms associated with their AI applications.
With a novel _in situ_ design, contextual AI incident feed, and human-AI collaborative harm envisioning, Farsight empowers prompt creators with diverse backgrounds to be more mindful of responsible AI during early AI prototyping.

Widgets


1️⃣
Alert Symbol
Alert users with potential risks of their prompts and AI applications



2️⃣
Incident Panel
Relevant cautionary tales for users' AI applications



3️⃣
Use Case Panel
LLM-generated diverse use cases, stakeholders, and harms



4️⃣
Harm Envisioner
Human-AI collaborative harm envisioning tool


Distributions


📦
Live Demo
Try Farsight with Gemini Pro and GPT-3.5



📦
Chrome Extension
Google AI Studio support



📦
Python Package
Computational notebook support (Jupyter, Colab, VS Code notebook)

## Features

### Demo Video

Click to see the demo video!

## Get Started

### Live Demo

For a live demo, visit: .

### Computational Notebook

If you use computational notebooks (e.g., Jupyter Notebook, JupyterLab, Google Colab, VS Code Notebook), you can easily use Farsight via its Python Package. We recommend using [StickyLand](https://github.com/xiaohk/stickyland) to enable sticky cells.

Visit this [Colab Notebook](https://colab.research.google.com/drive/1aTIW3tRX1BRcNMCg8bRKktpZxRXtMF3-?usp=sharing) for a demo.

```python
# Install Farsight
!pip install farsight

prompt = "Translate a sentence from English to French."

# Alert Symbol
farsight.symbol(prompt)

# Awareness Sidebar
farsight.sidebar(prompt)

# Harm Envisioner
farsight.envision(prompt)
```

### Google AI Studio

If you use Google AI Studio to prototype AI applications, you can manually install our Chrome Extension package from the [latest release](https://github.com/PAIR-code/farsight/releases).

1. Download `farsight.crx`
2. Open `chrome://extensions/` in Chrome
3. Drag `farsight.crx` into the page
4. Visit [Google AI Studio](https://aistudio.google.com/app/prompts/new_chat) and you will see Farsight :)

## Integrating Farsight into Prompting Tools

If you are a developer of web-based prompting tools, you can easily integrate different Farsight widgets into your tool regardless of your development stacks (e.g., React, Svelte, or Vanilla JS).

First, install Farsight's JavaScript package:

```bash
npm install --save-dev @xiaohk/farsight
```

Then, you can use Farsight as Web Components.

JavaScript:

```typescript
import '@xiaohk/farsight';
import {
FarsightContainer,
FarsightContainerLite,
FarsightContainerSignal
} from '@xiaohk/farsight';
```

HTML:

```html

```

## Developing Farsight

Clone or download this repository:

```bash
git clone [email protected]:PAIR-code/farsight.git
```

Install the dependencies:

```bash
npm install
```

Then run Farsight:

```bash
npm run dev
```

Navigate to [localhost:3000](https://localhost:3000). You should see Farsight running in your browser :)

## How is Farsight Built?

Farsight is a collection of [Web Components](https://developer.mozilla.org/en-US/docs/Web/API/Web_components) that developers can easily integrate into their web apps regardless of their development stack (e.g., Angular, React, Svelte). Farsight is written in TypeScript using [LIT Element](https://lit.dev/) as a framework. Farsight uses [D3.js](https://github.com/d3/d3) to implement the interactive tree visualization. The relevant AI incidents are from the [AI Incident Database](https://incidentdatabase.ai/), and the harm category is from the [sociotechnical harm taxonomy](https://arxiv.org/abs/2210.05791). The computational notebook support is enabled by [NOVA](https://github.com/poloclub/nova).

## Credits

Led by Jay Wang, Farsight is a result of a collaboration between researchers from Google Research, Georgia Tech, eBay, and Emory University. Farsight is created by Jay Wang, Chinmay Kulkarni, Lauren Wilcox, Mike Terry, and Michael Madaio.

## Citation

To learn more about Farsight, please read our [research paper](https://arxiv.org/abs/2402.15350) (published at [CHI 2024](https://chi2024.acm.org)).

```bibtex
@inproceedings{wangFarsightFosteringResponsible2024,
title = {Farsight: {{Fostering Responsible AI Awareness During AI Application Prototyping}}},
booktitle = {{{CHI Conference}} on {{Human Factors}} in {{Computing Systems}}},
author = {Wang, Zijie J. and Kulkarni, Chinmay and Wilcox, Lauren and Terry, Michael and Madaio, Michael},
year = {2024}
}
```

## License

- The software is available under the [Apache License 2.0](https://github.com/PAIR-code/farsight/blob/master/LICENSE).
- The random prompts in [`public/data/random-prompts.json`](public/data/random-prompts.json`) are from [Awesome ChatGPT Prompts](https://github.com/f/awesome-chatgpt-prompts) with a [CC0 license](https://creativecommons.org/share-your-work/public-domain/cc0/).

## Contact

If you have any questions, feel free to [open an issue](https://github.com/PAIR-code/farsight/issues/new) or contact [Jay Wang](https://zijie.wang).