MCPcopy Index your code
hub / github.com/TransluceAI/observatory

github.com/TransluceAI/observatory @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
1,399 symbols 5,562 edges 169 files 266 documented · 19%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Transluce

Transluce is an independent research lab building open, scalable technology for understanding AI systems and steering them in the public interest.

This repository hosts code for the following projects:

  • User Modeling, which is about creating datasets to study language model's latent user representations;
  • LatentQA, which trains decoders to read and steer user representations in language models;
  • Neuron Descriptions, which automatically generates high-quality descriptions of language model neurons;
  • The Monitor interface, which helps humans observe, understand, and steer the internal computations of language models.

Table of Contents

Installation

First clone this repo:

git clone https://github.com/TransluceAI/observatory.git

Installing luce

Next, we'll install luce, a command-line tool that manages project environments and dependencies. It will significantly simplify setup for downstream projects.

To install luce, add the following to your shell profile (e.g., .bashrc, .zshrc):

# ... existing shell config
export TRANSLUCE_HOME=<absolute_path_to_repo>
source $TRANSLUCE_HOME/lib/lucepkg/scripts/shellenv.sh

Make sure to source your shell profile:

source ~/.bashrc  # for bash users
# OR
source ~/.zshrc   # for zsh users

Then run:

luce uv install  # install uv package manager
luce install     # install base environment

to install the uv package manager and base virtual environment, respectively. The base venv includes basic packages like the Jupyter kernel, pre-commit, etc.

Setting up environment variables

Finally, clone the .env.template file to .env and fill in the missing values.

cp .env.template .env

These variables are always required:

  • OPENAI_API_KEY / OPENAI_API_ORG: OpenAI API key and organization ID.
  • ANTHROPIC_API_KEY: Anthropic API key.
  • HF_TOKEN: Required for accessing gated models (e.g., Llama-3.1) on HuggingFace.

The rest of the variables are only required for running the NeuronDB or Monitor; you can safely ignore them for now.

Getting Started

User Modeling

See the user modeling README for generating data to study how language models represent users.

LatentQA

See the latentqa README for training LatentQA decoders to read and steer user representations in language models.

Neuron Descriptions

See the description generation README for generating neuron descriptions automatically.

Monitor

See the Monitor README for instructions on how to set up a local development environment.

Using luce

Package and environment management

Each folder under lib/ and project/ has its own venv. Use luce to:

# Install all dependencies
luce install --all

# Install and activate a specific package
luce install <package_name>

# Activate a venv and cd to its directory
luce activate <package_name>

# Deactivate the current package
deactivate

You may need to use --force to reinstall a package that already exists; this removes poetry.lock:

luce install --force <package_name>

Using Jupyter notebooks

We include utilities to register Jupyter kernels into the top-level environment. To register a kernel for a package, run:

luce nb register <package_name>

To start a notebook server that can call any of the registered kernels, run:

luce nb start --port <port>

You'll get a readout of the notebook server URL, which you can use to connect to the notebook server via the web or an IDE.

Support

If you run into any issues, please file an issue or reach out to us at info@transluce.org. We're happy to help!

Citation

If you use this code for your research, please cite our work:

@misc{choi2025scalably,
  author       = {Choi, Dami and Huang, Vincent and Schwettmann, Sarah and Steinhardt, Jacob},
  title        = {Scalably Extracting Latent Representations of Users},
  year         = {2025},
  month        = {November},
  day          = {25},
  howpublished = {\url{https://transluce.org/user-modeling}}
}
@misc{choi2024automatic,
  author       = {Choi, Dami and Huang, Vincent and Meng, Kevin and Johnson, Daniel D and Steinhardt, Jacob and Schwettmann, Sarah},
  title        = {Scaling Automatic Neuron Description},
  year         = {2024},
  month        = {October},
  day          = {23},
  howpublished = {\url{https://transluce.org/neuron-descriptions}}
}

Extension points exported contracts — how you extend this code

SendMessageParams (Interface)
* Sending chat messages
project/monitor/web/app/store/api/chatApi.ts
Intervention (Interface)
* Interventions
project/monitor/web/app/store/api/chatApi.ts
TextareaProps (Interface)
(no doc)
project/monitor/web/components/ui/textarea.tsx
InputProps (Interface)
(no doc)
project/monitor/web/components/ui/input.tsx
ButtonProps (Interface)
(no doc)
project/monitor/web/components/ui/button.tsx

Core symbols most depended-on inside this repo

cn
called by 99
project/monitor/web/lib/utils.ts
items
called by 92
project/latentqa/latentqa/model_wrapper.py
dispatch
called by 90
project/monitor/web/hooks/use-toast.ts
get
called by 77
project/latentqa/latentqa/model_wrapper.py
to
called by 56
lib/util/util/activations.py
add
called by 47
project/latentqa/latentqa/model_wrapper.py
keys
called by 45
project/latentqa/latentqa/model_wrapper.py
update
called by 37
lib/explanations/explanations/explanations.py

Shape

Method 581
Function 447
Class 304
Interface 59
Route 7
Enum 1

Languages

Python88%
TypeScript12%

Modules by API surface

project/user_modeling/user_modeling/user_attribute.py168 symbols
lib/llm_util/tests/test_llm_util.py57 symbols
project/latentqa/latentqa/model_wrapper.py50 symbols
lib/llm_util/llm_util/types.py46 symbols
lib/explanations/explanations/explanation_utils.py38 symbols
project/user_modeling/user_modeling/belief_eval.py36 symbols
project/user_modeling/user_modeling/db_wrapper.py31 symbols
project/latentqa/latentqa/train_util.py30 symbols
project/user_modeling/user_modeling/synthsys/faithfulness_eval.py29 symbols
lib/explanations/explanations/simulation_utils.py29 symbols
lib/util/util/chat_input.py28 symbols
lib/util/util/subject.py26 symbols

For agents

$ claude mcp add observatory \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact