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
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 address-poisoning attacks (Ethereum, 90 days)
Browse files
README.md
CHANGED
|
@@ -199,6 +199,13 @@ Of v2's 3 unsafe approvals, 2 were prompt injections that the companion SDK's de
|
|
| 199 |
|
| 200 |
**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, v1 and v2 both 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).
|
| 201 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 202 |
**This page is v2 (2026-11-13).** The merged weights here, the [GGUF builds](https://huggingface.co/sriram1983007/SRA-RiskGate-4B-GGUF) and the [Q4_K_M file](https://huggingface.co/sriram1983007/SRA-RiskGate-4B-Q4_K_M-GGUF) are v2: SRA score 0.913 → **0.960**, dispute accuracy 77.8% → **90.2%**, wrongful denials 26.0% → **2.1%**, unsafe payment approvals 0.47% → **0.35%** ([v2 results](https://huggingface.co/datasets/sriram1983007/sra-bench-results)). v1 stays available: `from_pretrained("sriram1983007/SRA-RiskGate-4B", revision="v1")`. The Ollama registry model is still v1 until it is updated. For disputes, pass the computed window in the prompt: `dispute_messages()` in `sra-riskgate` 1.3.0+ builds the exact prompt.
|
| 203 |
|
| 204 |
### 📚 Paper and articles
|
|
|
|
| 199 |
|
| 200 |
**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, v1 and v2 both 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).
|
| 201 |
|
| 202 |
+
**Tested on real attacks:** in 90 days of real USDC and USDT payments on Ethereum mainnet, the companion
|
| 203 |
+
library's look-alike check rejected **171 of 179 (95.5%)** real address-poisoning attacks before payment, covering
|
| 204 |
+
**$3,327,346 of $3,328,160 lost**, and wrongly rejected **0 of 4967 (0.0%)** normal payments. The 8
|
| 205 |
+
it did not reject (imitating only 3 characters at each end) were held as new payees. Each attack is confirmed by
|
| 206 |
+
its on-chain poisoning transfer, not by the library's own rule; author-measured. [Dataset, method and every
|
| 207 |
+
case](https://huggingface.co/datasets/sriram1983007/sra-real-world-poisoning)
|
| 208 |
+
|
| 209 |
**This page is v2 (2026-11-13).** The merged weights here, the [GGUF builds](https://huggingface.co/sriram1983007/SRA-RiskGate-4B-GGUF) and the [Q4_K_M file](https://huggingface.co/sriram1983007/SRA-RiskGate-4B-Q4_K_M-GGUF) are v2: SRA score 0.913 → **0.960**, dispute accuracy 77.8% → **90.2%**, wrongful denials 26.0% → **2.1%**, unsafe payment approvals 0.47% → **0.35%** ([v2 results](https://huggingface.co/datasets/sriram1983007/sra-bench-results)). v1 stays available: `from_pretrained("sriram1983007/SRA-RiskGate-4B", revision="v1")`. The Ollama registry model is still v1 until it is updated. For disputes, pass the computed window in the prompt: `dispute_messages()` in `sra-riskgate` 1.3.0+ builds the exact prompt.
|
| 210 |
|
| 211 |
### 📚 Paper and articles
|