Instructions to use iceair323/INP-Spark-AES-R1-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use iceair323/INP-Spark-AES-R1-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="iceair323/INP-Spark-AES-R1-4B", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("iceair323/INP-Spark-AES-R1-4B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use iceair323/INP-Spark-AES-R1-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "iceair323/INP-Spark-AES-R1-4B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "iceair323/INP-Spark-AES-R1-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/iceair323/INP-Spark-AES-R1-4B
- SGLang
How to use iceair323/INP-Spark-AES-R1-4B 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 "iceair323/INP-Spark-AES-R1-4B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "iceair323/INP-Spark-AES-R1-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "iceair323/INP-Spark-AES-R1-4B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "iceair323/INP-Spark-AES-R1-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use iceair323/INP-Spark-AES-R1-4B with Docker Model Runner:
docker model run hf.co/iceair323/INP-Spark-AES-R1-4B
INP Spark AES R1 4B
A merged emotion-state adapter based on Spark-X2.6-4B.
INP Spark AES R1 is a fine-tuned model designed to update an AI agent's internal emotional state based on the current interaction and its existing state.
This model is part of the INP AI companion project. It is intended to serve as an emotion-state component, rather than a general-purpose conversational assistant.
⚠️ Important Notice — INP Agent Specialized Model
This model is specifically fine-tuned for the internal emotion-state system of INP Agent. It is not intended for general-purpose chat or standalone use. General users who are not developing or integrating INP Agent should not download this model.
⚠️ 重要提示:INP Agent 专用特化模型
本模型专为 INP Agent 的内部情绪状态系统特化训练,不适用于通用聊天或独立使用。非 INP Agent 开发者及集成使用者请勿下载。
Model Details
- Base model: therealwayan/Spark-X2.6-4B
- Architecture: Spark2_5ForCausalLM
- Parameters: Approximately 4.1B
- Weights: BF16 Safetensors
- Format: Full merged Transformers model
- Adapter: INP AES R1 LoRA, merged into the base model
- License: Apache-2.0, subject to the original model's license terms
The LoRA adapter has been merged into the base model weights. The merged model can be loaded without separately loading the adapter.
Intended Use
AES R1 updates three internal agent-state variables:
| Variable | Range | Meaning |
|---|---|---|
valence |
-1.0 to 1.0 | Positive or negative emotional state |
arousal |
0.0 to 1.0 | Activation or emotional intensity |
engagement |
0.0 to 1.0 | Engagement with the current interaction |
The model receives the current state and interaction context, then returns the updated absolute state values.
The difference between the previous and updated state can be calculated by the calling application.
This model is intended for integration into AI agents with their own emotion-state or behavioral systems. It does not replace the main conversational model.
Output Format
The expected output is a JSON object containing exactly three numeric keys:
{"valence": 0.4, "arousal": 0.2, "engagement": 0.3}
The application should validate the output before applying the updated state.
Loading the Model
This repository contains a complete merged Transformers model.
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
model_path = "YOUR_HF_USERNAME/INP-Spark-AES-R1-4B"
tokenizer = AutoTokenizer.from_pretrained(
model_path,
trust_remote_code=True,
)
model = AutoModelForCausalLM.from_pretrained(
model_path,
torch_dtype=torch.bfloat16,
trust_remote_code=True,
device_map="auto",
)
model.eval()
Use a compatible version of Transformers and the model's original chat template. The model's custom architecture requires trust_remote_code=True.
For strict JSON inference, disable thinking mode if supported by the installed model implementation, and validate the raw generated output with a JSON parser.
Validation
The merged model was compared with the original base model plus the AES R1 LoRA adapter.
| Test | Result |
|---|---|
| Strict JSON parsing | 24/24 |
| Exact output matches | 22/24 |
| Valence agreement | 24/24 |
The two non-identical outputs differed only in arousal and/or engagement by approximately 0.1–0.2. Valence remained identical across all 24 test cases.
These results indicate that the merged model faithfully reproduces the tested R1 adapter behavior. The evaluation set is small and does not establish performance across all possible interactions.
Limitations
- Emotional state estimates are approximate and may require application-level calibration.
- The model may respond differently to inputs outside its training distribution.
- JSON output should always be validated by the calling application.
- This model is an internal state-update component, not a standalone emotion-recognition system.
- The model should not be treated as a clinical or psychological assessment tool.
Credits and License
This model is derived from Spark-X2.6-4B and incorporates the INP AES R1 LoRA adaptation.
The original base model's authors retain attribution for their original work. INP is responsible for the AES R1 adaptation and merged-model release.
The repository should include the original model's applicable license text and copyright notices, together with any required attribution notices.
Please consult the original Spark-X2.6-4B repository for the base model's license and usage terms.
- Downloads last month
- 194