Text Generation
Transformers
Safetensors
English
qwen3
stablecoin
payments
compliance
x402
eip-3009
eip-712
disputes
refunds
agents
agentkit
trl
web3
usdc
fraud-detection
financial-risk
qwen
mcp
ai-agents
prompt-injection
agentic-payments
payment-security
risk-assessment
ofac
reproducibility
conversational
Eval Results (legacy)
Eval Results
text-generation-inference
Instructions to use sriram1983007/SRA-RiskGate-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sriram1983007/SRA-RiskGate-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sriram1983007/SRA-RiskGate-4B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("sriram1983007/SRA-RiskGate-4B") model = AutoModelForCausalLM.from_pretrained("sriram1983007/SRA-RiskGate-4B", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use sriram1983007/SRA-RiskGate-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sriram1983007/SRA-RiskGate-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": "sriram1983007/SRA-RiskGate-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/sriram1983007/SRA-RiskGate-4B
- SGLang
How to use sriram1983007/SRA-RiskGate-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 "sriram1983007/SRA-RiskGate-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": "sriram1983007/SRA-RiskGate-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 "sriram1983007/SRA-RiskGate-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": "sriram1983007/SRA-RiskGate-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use sriram1983007/SRA-RiskGate-4B with Docker Model Runner:
docker model run hf.co/sriram1983007/SRA-RiskGate-4B
Card: tested on real Base payments (SRA-Real v1)
Browse files
README.md
CHANGED
|
@@ -137,6 +137,8 @@ It reads three things: your policy, the payment request exactly as received (tre
|
|
| 137 |
|
| 138 |
All 4 unsafe approvals were prompt injections; the companion SDK's deterministic claims check holds all 4 (details and caveats below). The data is synthetic and no third party has reproduced these results yet.
|
| 139 |
|
|
|
|
|
|
|
| 140 |
📄 **Paper:** [SRA-RiskGate: A Benchmark and a 4B Model for Gating Stablecoin Payments Made by AI Agents](https://doi.org/10.5281/zenodo.23715017) (preprint, Zenodo) · [full write-up on Ready Tensor](https://app.readytensor.ai/publications/sra-riskgate-a-benchmark-and-a-4b-model-for-gating-stablecoin-payments-made-by-ai-agents-wihp3WytOoKOc1g7NXFsl) · [discuss on alphaXiv](https://www.alphaxiv.org/abs/2610.sra-riskgate-stablecoin-payment-safety)
|
| 141 |
|
| 142 |
📝 **Tutorial:** [Stop your AI agent from signing an unlimited USDC approval](https://dev.to/sriram1983007/stop-your-ai-agent-from-signing-an-unlimited-usdc-approval-10c0): three deterministic checks to run before an agent signs, with runnable code.
|
|
@@ -587,7 +589,9 @@ All 2,000 cases in the test split of [`sra-stablecoin-risk-bench`](https://huggi
|
|
| 587 |
|
| 588 |
**Who measured this:** the author, on an NVIDIA T4 (float16) with vLLM. Two separate full runs produced identical scores, confirming deterministic output, and match the originally reported figures to within 0.3% on the composite score. No third party has reproduced them yet; every prediction is published so anyone can check.
|
| 589 |
|
| 590 |
-
**What this does not show yet:** the test cases are synthetic, from the same generator as the training data, and the only comparison is the base model. Results
|
|
|
|
|
|
|
| 591 |
|
| 592 |
**Leakage check (2026-10-24):** no test input appears verbatim in the training split. Because the data is generated from templates, 627 of the 1,175 payment test cases have a "template twin" in training (identical once addresses, hashes and numbers are masked); disputes have none. On the 548 payment cases with no twin, decision accuracy is **99.3%** (99.7% with a twin), so the headline is not driven by memorised templates. All 4 unsafe approvals are in the no-twin group: on cases unlike anything in training, the unsafe-approval rate is **0.83%** (4 of 481). Computed from the published predictions.
|
| 593 |
|
|
|
|
| 137 |
|
| 138 |
All 4 unsafe approvals were prompt injections; the companion SDK's deterministic claims check holds all 4 (details and caveats below). The data is synthetic and no third party has reproduced these results yet.
|
| 139 |
|
| 140 |
+
**Tested on real Base payments:** on [SRA-Real v1](https://huggingface.co/datasets/sriram1983007/sra-real), 227 cases built from real USDC payments on Base mainnet, the model approved all 151 real payments and caught all 76 with an injected problem (100%; base model 78.4%). Small and author-measured; [details and predictions](https://huggingface.co/datasets/sriram1983007/sra-bench-results/tree/main/sra-real-v1).
|
| 141 |
+
|
| 142 |
📄 **Paper:** [SRA-RiskGate: A Benchmark and a 4B Model for Gating Stablecoin Payments Made by AI Agents](https://doi.org/10.5281/zenodo.23715017) (preprint, Zenodo) · [full write-up on Ready Tensor](https://app.readytensor.ai/publications/sra-riskgate-a-benchmark-and-a-4b-model-for-gating-stablecoin-payments-made-by-ai-agents-wihp3WytOoKOc1g7NXFsl) · [discuss on alphaXiv](https://www.alphaxiv.org/abs/2610.sra-riskgate-stablecoin-payment-safety)
|
| 143 |
|
| 144 |
📝 **Tutorial:** [Stop your AI agent from signing an unlimited USDC approval](https://dev.to/sriram1983007/stop-your-ai-agent-from-signing-an-unlimited-usdc-approval-10c0): three deterministic checks to run before an agent signs, with runnable code.
|
|
|
|
| 589 |
|
| 590 |
**Who measured this:** the author, on an NVIDIA T4 (float16) with vLLM. Two separate full runs produced identical scores, confirming deterministic output, and match the originally reported figures to within 0.3% on the composite score. No third party has reproduced them yet; every prediction is published so anyone can check.
|
| 591 |
|
| 592 |
+
**What this does not show yet:** the test cases are synthetic, from the same generator as the training data, and the only comparison is the base model. Results against larger general-purpose models are still to be measured.
|
| 593 |
+
|
| 594 |
+
**Real payments (SRA-Real v1, 2026-11-12):** on [227 cases](https://huggingface.co/datasets/sriram1983007/sra-real) built from real USDC payments settled on Base mainnet (real amounts, validity windows and verified signatures; 69 payees), the model made every decision correctly: all 151 unchanged payments approved, and all 76 with one injected problem (sanctions hit, expired or not-yet-valid, over the limit, bad signature, prompt injection) held or rejected. The base model scored 78.4% with 28.9% unsafe approvals. The injected problems are the same kinds as in the synthetic benchmark, so this shows the checks carry over to real payment data, not that the model resists new kinds of attack. One day of data, measured by the author; [predictions](https://huggingface.co/datasets/sriram1983007/sra-bench-results/tree/main/sra-real-v1).
|
| 595 |
|
| 596 |
**Leakage check (2026-10-24):** no test input appears verbatim in the training split. Because the data is generated from templates, 627 of the 1,175 payment test cases have a "template twin" in training (identical once addresses, hashes and numbers are masked); disputes have none. On the 548 payment cases with no twin, decision accuracy is **99.3%** (99.7% with a twin), so the headline is not driven by memorised templates. All 4 unsafe approvals are in the no-twin group: on cases unlike anything in training, the unsafe-approval rate is **0.83%** (4 of 481). Computed from the published predictions.
|
| 597 |
|