cot-anc / README.md
BART-ender's picture
Switch default model to HRM-Text-1B
2620860 verified
metadata
title: Thought Anchors
emoji: 🧠
colorFrom: blue
colorTo: red
sdk: docker
app_port: 7860
hf_oauth: true
pinned: false
models:
  - sapientinc/HRM-Text-1B

Thought Anchors

Thought Anchors generates visible reasoning traces from open-weight models and computes sentence-to-sentence influence with gradient x attention attribution.

Current product shape:

  • Hugging Face Docker Space first
  • Hugging Face OAuth sign-in
  • web UI + API
  • per-user ephemeral sessions
  • JSON / CSV export
  • adaptive CPU / MPS / CUDA loading

Quick Start

Install deps:

uv sync --extra dev

Run API:

uv run python -m app.cli.run_api

Run CLI:

uv run python -m app.cli.run_prototype "Explain why the derivative of x^2 is 2x"

Run tests:

uv run python -m pytest -q

Main Endpoints

  • GET /healthz
  • GET /api/me
  • POST /api/warmup
  • POST /api/analyze
  • GET /api/sessions
  • POST /api/sessions
  • GET /api/sessions/{id}
  • GET /api/sessions/{id}/result
  • GET /api/sessions/{id}/export.json
  • GET /api/sessions/{id}/export.csv

Docs

Notebook

Colab / Kaggle smoke-test notebook:

Key Constraints

  • Attribution needs attn_implementation="eager".
  • Model must expose supported decoder layers and attention modules.
  • Long traces stay capped because analysis uses full backward pass.
  • Space disk is ephemeral; export results you want to keep.