Views
No views yet
veritasnet/core/hawkes_kernel.py)veritasnet/core/rpp_detector.py)veritasnet/models/)veritasnet/mirofish/live_simulation.py)1from veritasnet.mirofish.live_simulation import LiveRPPSimulation
2from veritasnet.mirofish.integration import RPPAgentProfileGenerator
3
4# Generate RPP campaign agent profiles
5gen = RPPAgentProfileGenerator()
6profiles = gen.generate_campaign_profiles(n_operators=5, n_amplifiers=15, n_organic=50)
7
8# Run live simulation with open-source LLM
9sim = LiveRPPSimulation(
10 # Option A: Ollama (local, free)
11 llm_base_url="http://localhost:11434/v1",
12 llm_model="qwen2.5:7b",
13 llm_api_key="ollama",
14
15 # Option B: vLLM (local, fast)
16 # llm_base_url="http://localhost:8000/v1",
17 # llm_model="Qwen/Qwen2.5-7B-Instruct",
18
19 # Option C: HuggingFace Inference API
20 # llm_base_url="https://api-inference.huggingface.co/v1",
21 # llm_model="Qwen/Qwen2.5-72B-Instruct",
22 # llm_api_key="hf_YOUR_TOKEN",
23)
24
25# Run simulation — each agent uses LLM to decide actions
26profile_dicts = [{'user_id': p.user_id, 'username': p.username,
27 'name': p.name, 'persona': p.persona} for p in profiles]
28actions_path = sim.run(profile_dicts, n_rounds=50, agents_per_round=10)
29
30# Get citation graph for VERITASNET detection
31src, dst, timestamps = sim.get_citation_graph()| Backend | Setup | Model | Notes |
|---|---|---|---|
| Ollama | ollama serve then ollama pull qwen2.5:7b | qwen2.5:7b, llama3.1:8b, mistral:7b | Easiest local setup |
| vLLM | vllm serve Qwen/Qwen2.5-7B-Instruct | Any HF model | Fastest inference |
| llama.cpp | ./llama-server -m model.gguf | GGUF quantized models | Low RAM usage |
| HF TGI | docker run ghcr.io/huggingface/text-generation-inference | Any HF model | Production ready |
| HF Inference API | No setup needed | Qwen2.5-72B, Llama-3.1-70B | Free tier available |
1from veritasnet.pipeline import VeritasNetPipeline
2
3pipeline = VeritasNetPipeline(
4 output_dir='./output',
5 device='cpu', # or 'cuda'
6 config={
7 'n_domains': 10000,
8 'n_edges': 100000,
9 'n_snapshots': 6,
10 'tgn_epochs': 10,
11 'adv_epochs': 5,
12 }
13)
14
15# Run complete detection pipeline
16reports = pipeline.run_full_pipeline()
17
18# Also generate MiroFish-compatible configs
19pipeline.generate_mirofish_config()| System | Precision | Recall | F1 | Detection Lag |
|---|---|---|---|---|
| Static baseline (CrediBench-like) | 0.000 | 0.000 | 0.000 | N/A (blind) |
| 3-Signal RPP Detector | 0.968 | 0.750 | 0.845 | 140 ± 45 days |
| VERITASNET (full) | 0.793 | 0.767 | 0.780 | 142 ± 45 days |
veritasnet/
├── core/
│ ├── hawkes_kernel.py # Hawkes process credibility kernel (pure PyTorch)
│ └── rpp_detector.py # Three-signal RPP detector (CVA + HFH + DAAG)
├── models/
│ ├── temporal_gnn.py # TGN with dual credibility/RPP heads
│ └── adversarial.py # PGD adversarial training + defenses
├── simulation/
│ └── rpp_simulator.py # Synthetic RPP campaign generator
├── data/
│ └── web_graph.py # CommonCrawl WAT extraction + graph builder
├── evaluation/
│ └── metrics.py # Full evaluation suite
├── mirofish/
│ ├── integration.py # Profile generation + config + output conversion
│ └── live_simulation.py # ★ Live LLM-driven agent simulation (camel-ai)
├── pipeline.py # End-to-end orchestrator
└── utils/torch>=2.0
torch_geometric>=2.5
scipy
scikit-learn
numpy
pandas
camel-ai # For live agent simulation
openai # OpenAI-compatible API client
warcio (optional) # For WAT file processinglive_simulation.py: Runs real LLM-driven agent simulations using camel-ai + any open-source LLM (Qwen2.5, Llama3, Mistral). Each agent gets a persona and autonomously decides to post, like, repost, or follow — producing realistic social media dynamics. Output is MiroFish-compatible actions.jsonl.integration.py: Generates MiroFish/OASIS-compatible agent profiles (Twitter CSV + Reddit JSON), simulation configs, and converts simulation output to VERITASNET citation graphs.