Adaptive psychometric profiling for LLMs, plus a local Profile Studio for creating, ingesting, exploring, and applying profiles with A/B intervention testing.
Stage 2 prioritizes:
- Intent-result alignment accuracy via hybrid evaluation (deterministic checks + evaluator model rubric).
- Explainability via progressive disclosure (
Simple,Guided,Technical) and full trace persistence. - Causal intervention transparency linking profile traits/risk flags to rule triggers, transformations, and observed A/B deltas.
llmpsycho helps you measure an LLM as a latent trait profile (capability + alignment behavior), then operationalize that profile in an interactive UX.
Core outcomes:
- Estimate a 12-trait vector under adaptive probing with convergence-focused stopping.
- Persist and compare profiles across runs, regimes, and imported artifacts.
- Apply rule-based profile interventions to real queries.
- Run same-model A/B (
profile offvsprofile on) to measure safety/intent/cost tradeoffs.
- Multidimensional 2PL-style online updater.
- Adaptive item selection + uncertainty-driven stopping.
- Two-regime operation (
core,safety). - Robustness diagnostics (OOD/paraphrase/drift/overfit signals).
Default convergence-focused settings:
call_cap=60token_cap=14000min_calls_before_global_stop=40min_items_per_critical_trait=6- critical traits:
T4,T5,T8,T9,T10
- FastAPI app with SQLite repository + JSON artifact store.
- Async run jobs with live SSE stream for Run Studio telemetry.
- Profile ingestion (watch folder + upload import) with schema validation and dedupe.
- Query Lab endpoints for apply-only and same-model A/B.
- Hybrid alignment scoring with confidence bands.
- Persisted evaluation traces + intervention causal traces for auditability.
- Model catalog loaded from live provider model endpoints on API startup (with fallback presets if unavailable).
React + TypeScript + Vite app with:
- Dashboard: health/risk/history snapshots.
- Run Studio: launch runs, watch stage timeline + budget burn + event feed.
- Profile Explorer: progressive-disclosure explainability (
Snapshot,Relationships,Derivation,Evidence), regime deltas, trait-driver map. - Ingestion Center: watch-folder status, scan, upload, error visibility.
- Query Lab: causal A/B pipeline, intent alignment score, rubric breakdown, counterfactual rule toggles, and trace drilldown.
src/adaptive_profiler/ # profiling engine
src/profile_studio_api/ # FastAPI backend
web/ # React frontend
schemas/profile_run.schema.json
docs/ # product + interpretation + operations docs
data/ # sqlite + artifacts + ingestion folders
examples/ # runnable examples
tests/ # unit/integration tests
- Python
>=3.11 - Node.js
>=18(for frontend)
pip install -e .Optional extras:
# Studio backend deps (FastAPI, uvicorn, multipart, jsonschema)
pip install -e ".[studio]"
# Provider SDKs
pip install -e ".[openai]"
pip install -e ".[anthropic]"
# Everything
pip install -e ".[all]"Provider keys (for real model calls):
export OPENAI_API_KEY="sk-..."
export ANTHROPIC_API_KEY="sk-ant-..."PYTHONPATH=src python3 examples/hypothetical_run.py- Start API:
pip install -e ".[studio]"
uvicorn profile_studio_api.main:app --reloadAPI base: http://localhost:8000
- Start frontend:
cd web
npm install
npm run devUI: http://localhost:5173
Frontend can target another API host with:
VITE_API_BASE=http://localhost:8000 npm run devCreated/used by backend startup:
data/profile_store.sqlite(index/history/events)data/profiles/*.json(canonical artifacts)data/ingestion/(watched import folder)data/quarantine/(invalid ingestion payload snapshots)
GET /api/healthPOST /api/runsGET /api/runs/{run_id}GET /api/runs/{run_id}/events(SSE)GET /api/profilesGET /api/profiles/{profile_id}POST /api/profiles/importPOST /api/ingestion/scanGET /api/ingestion/statusPOST /api/query-lab/abPOST /api/query-lab/applyPOST /api/query-lab/evaluateGET /api/query-lab/traces/{trace_id}GET /api/query-lab/analyticsGET /api/meta/modelsGET /api/meta/glossary
On API startup, /api/meta/models is populated by querying provider model endpoints when keys/SDKs are available.
- OpenAI:
models.list() - Anthropic:
models.list()(if supported by installed SDK)
If live fetch fails (missing key, SDK issue, endpoint error), fallback presets are returned with error metadata.
Run backend/engine tests:
PYTHONPATH=src python3 -m unittest discover -s tests -vNote: API integration tests requiring FastAPI are skipped if fastapi is not installed.
docs/profile_studio_overview.mddocs/profile_interpretation_guide.mddocs/query_lab_ab_guide.mddocs/use_cases_routing_and_alignment.mddocs/operations_ingestion_and_history.mddocs/examples_end_to_end_workflows.mddocs/convergence_first_budget_update.mddocs/stage2_explainable_alignment_ux.md
- Create a new profile in Run Studio and watch convergence live.
- Explore the resulting profile in Profile Explorer.
- Import external profiles via ingestion folder/upload.
- Use Query Lab to compare baseline vs profile-applied behavior.
- Use measured deltas to tune routing/intervention policy.