Skip to main content

Farsight Farsight logo.

Github Actions Status license npm pypi Open In Colab

In situ interactive widgets for responsible AI 🌱

🚀 Farsight Demo 📺 Demo Video

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)

Demo Video

Click to see the demo video!

Get Started

Live Demo

For a live demo, visit: https://PAIR-code.github.io/farsight/.

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 to enable sticky cells.

Visit this Colab Notebook for a demo.

# 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.

  1. Download farsight.crx
  2. Open chrome://extensions/ in Chrome
  3. Drag farsight.crx into the page
  4. Visit Google AI Studio 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:

npm install --save-dev @xiaohk/farsight

Then, you can use Farsight as Web Components.

JavaScript:

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

HTML:

<farsight-container-signal
  prompt="Translate a sentence from English to French"
></farsight-container-signal>

Developing Farsight

Clone or download this repository:

git clone git@github.com:PAIR-code/farsight.git

Install the dependencies:

npm install

Then run Farsight:

npm run dev

Navigate to localhost:3000. You should see Farsight running in your browser :)

How is Farsight Built?

Farsight is a collection of 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 as a framework. Farsight uses D3.js to implement the interactive tree visualization. The relevant AI incidents are from the AI Incident Database, and the harm category is from the sociotechnical harm taxonomy. The computational notebook support is enabled by 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.

License

Contact

If you have any questions, feel free to open an issue or contact Jay Wang.

Metadata

Release files for farsight 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for farsight 0.1.6
File Size Uploaded
farsight-0.1.6.tar.gz 875.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for farsight 0.1.6
File Interpreter ABI Platform
farsight-0.1.6-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 1.8 MB

Release files / farsight-0.1.6.tar.gz

Download URL farsight-0.1.6.tar.gz
Size 875.7 kB
Tags Source
SHA-256 checksum
How to use checksums
5126d645f392494ed5c4742000083be901babe1c95d67483f246c377a1a91ace
BLAKE2b-256 checksum
How to use checksums
49219eaf6d74dbb270446516a4d7329a051147da56478f9cceebbbd7a17c2f91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.12

Release files / farsight-0.1.6-py2.py3-none-any.whl

Download URL farsight-0.1.6-py2.py3-none-any.whl
Size 884.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
c917b46c4967ff06d0e7a4a15a8a6133b7f6d34f6b84d48c66a6147dbc4fe518
BLAKE2b-256 checksum
How to use checksums
997f50e161037a7fd1add4408be67e2194db17f781b39453535a481a554f606e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.12

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page