Text Generation
Transformers
Safetensors
English
psychometrics
personality
mental-health
computational-psychology
adapter-tuning
Instructions to use huvucode/PsychAdapter with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use huvucode/PsychAdapter with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="huvucode/PsychAdapter")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("huvucode/PsychAdapter", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use huvucode/PsychAdapter with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "huvucode/PsychAdapter" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "huvucode/PsychAdapter", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/huvucode/PsychAdapter
- SGLang
How to use huvucode/PsychAdapter with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "huvucode/PsychAdapter" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "huvucode/PsychAdapter", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "huvucode/PsychAdapter" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "huvucode/PsychAdapter", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use huvucode/PsychAdapter with Docker Model Runner:
docker model run hf.co/huvucode/PsychAdapter
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,8 +1,74 @@
|
|
| 1 |
---
|
| 2 |
license: openrail
|
| 3 |
datasets:
|
| 4 |
-
- huvucode/PsychAdapter
|
| 5 |
language:
|
| 6 |
-
- en
|
| 7 |
pipeline_tag: text-generation
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: openrail
|
| 3 |
datasets:
|
| 4 |
+
- huvucode/PsychAdapter
|
| 5 |
language:
|
| 6 |
+
- en
|
| 7 |
pipeline_tag: text-generation
|
| 8 |
+
tags:
|
| 9 |
+
- psychometrics
|
| 10 |
+
- personality
|
| 11 |
+
- mental-health
|
| 12 |
+
- big-five
|
| 13 |
+
- depression
|
| 14 |
+
- computational-psychology
|
| 15 |
+
- adapter-tuning
|
| 16 |
+
library_name: transformers
|
| 17 |
+
doi: 10.1038/s44387-026-00071-9
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
# PsychAdapter: Adapting LLM Transformers to Reflect Traits, Personality and Mental Health
|
| 21 |
+
|
| 22 |
+
PsychAdapter is a modular framework designed to adapt Large Language Models (LLMs) to reflect specific psychological traits and mental health states. By utilizing parameter-efficient adapters, the model can be steered to exhibit diverse psychological profiles without compromising the foundational capabilities of the base transformer.
|
| 23 |
+
|
| 24 |
+
## Model Details
|
| 25 |
+
|
| 26 |
+
- **Developed by:** Huy Vu, et al.
|
| 27 |
+
- **Published in:** *npj Artificial Intelligence* (Nature Portfolio)
|
| 28 |
+
- **Model Type:** Adapter-based LLM (optimized for Llama-series architectures)
|
| 29 |
+
- **Language(s):** English
|
| 30 |
+
- **License:** OpenRAIL
|
| 31 |
+
- **Repository:** [GitHub - humanlab/psychadapter](https://github.com/humanlab/psychadapter)
|
| 32 |
+
- **Paper:** [Nature npj AI (2026)](https://www.nature.com/articles/s44387-026-00071-9)
|
| 33 |
+
|
| 34 |
+
## Intended Use
|
| 35 |
+
|
| 36 |
+
This model is designed for research in:
|
| 37 |
+
- **Computational Psychology:** Simulating human-like personality variations in dialogue.
|
| 38 |
+
- **Social Science Research:** Modeling communication patterns associated with specific traits.
|
| 39 |
+
- **Personalized AI:** Developing adaptive interfaces that align with user psychological profiles.
|
| 40 |
+
|
| 41 |
+
### Limitations
|
| 42 |
+
This tool is for research purposes and should not be used for clinical diagnosis or formal psychological assessment.
|
| 43 |
+
|
| 44 |
+
## Training & Dataset
|
| 45 |
+
|
| 46 |
+
The model is trained and validated on the **PsychAdapter dataset** (available at `huvucode/PsychAdapter`). This dataset includes training/validation splits enriched with granular psychological labels, specifically:
|
| 47 |
+
|
| 48 |
+
* **Big Five Personality Traits:** Openness, Conscientiousness, Extraversion, Agreeableness, and Neuroticism (OCEAN).
|
| 49 |
+
* **Mental Health Scores:** Quantitative markers for **Depression** and **Life Satisfaction**.
|
| 50 |
+
|
| 51 |
+
These traits are used to steer the generative process, allowing the model to reflect specific psychological phenotypes in text generation.
|
| 52 |
+
|
| 53 |
+
## Training Procedure
|
| 54 |
+
|
| 55 |
+
The framework utilizes parameter-efficient fine-tuning (PEFT) to integrate psychological trait embeddings within the Transformer layers.
|
| 56 |
+
|
| 57 |
+
* **Infrastructure:** PyTorch, Hugging Face Transformers, PEFT.
|
| 58 |
+
* **Optimization:** High-performance GPU kernels (Transformer Engine) and low-precision training (FP8/BF16) were utilized to maintain efficiency during the adaptation process.
|
| 59 |
+
|
| 60 |
+
## Citation
|
| 61 |
+
|
| 62 |
+
If you use these checkpoints or the dataset in your research, please cite:
|
| 63 |
+
|
| 64 |
+
```bibtex
|
| 65 |
+
@article{vu2026psychadapter,
|
| 66 |
+
title={PsychAdapter: Adapting LLM Transformers to Reflect Traits, Personality and Mental Health},
|
| 67 |
+
author={Vu, Huy and Nguyen, Huy Anh and Ganesan, Adithya V. and Juhng, Swanie and Kjell, Oscar N. E. and Sedoc, Joao and Kern, Margaret L. and Boyd, Ryan L. and Ungar, Lyle and Schwartz, H. Andrew and Eichstaedt, Johannes C.},
|
| 68 |
+
journal={npj Artificial Intelligence},
|
| 69 |
+
volume={1},
|
| 70 |
+
number={1},
|
| 71 |
+
year={2026},
|
| 72 |
+
publisher={Nature Publishing Group},
|
| 73 |
+
doi={10.1038/s44387-026-00071-9}
|
| 74 |
+
}
|