Skip to main content

agorasim

Opinion dynamics with LLM agents on social networks, where different agents run on different language models. Extends Wang et al. (COLING 2025) with a multi-model ensemble and individual-level trajectory inspection.

Setup

uv sync                      # core + dev tools
uv sync --extra analysis     # + DuckDB, statsmodels, ruptures, plotting
cp .env.example .env         # add API keys you need

Usage

uv run agorasim baseline configs/bc_small_world.yaml   # numeric baseline + metrics
uv run agorasim ping ollama/llama3.1                   # check a model is reachable
uv run pytest

Runs are written to runs/<timestamp>_<name>_s<seed>/: meta.json (config + git commit), trajectory.parquet (step, agent, opinion), metrics.parquet.

Layout

src/agorasim/
  config.py     typed YAML experiment configs (Pydantic)
  networks.py   Erdős–Rényi / Watts–Strogatz / Barabási–Albert, initial opinions
  baselines.py  DeGroot, bounded confidence, Deffuant, Friedkin–Johnsen
  metrics.py    polarization, global disagreement, neighbour correlation (Wang et al. §4.2)
  llm.py        one async client for every provider (LiteLLM) + disk cache + fake backend
  runs.py       run directories and Parquet output
  cli.py        `agorasim` command

Models

Any LiteLLM model string works: anthropic/…, openai/…, xai/…, deepseek/…, ollama/… (local), or openai/<model> with api_base pointing at a vLLM server (INDACO). fake/<anything> is a deterministic offline backend for tests.

Roadmap

  • M0 — skeleton, configs, LLM client, caching
  • M1 — networks, numeric baselines, metrics
  • M2 — single-model LLM replication of Wang et al. (personas, memory, classifier scoring)
  • M3 — multi-model ensemble
  • M4 — rewiring + recommender
  • M5 — individual trajectory tooling
  • M6 — INDACO: vLLM + SLURM sweeps
  • M7 — d3 visualization

Release files for agorasim 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agorasim 0.0.1
File Size Uploaded
agorasim-0.0.1.tar.gz 272.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for agorasim 0.0.1
File Interpreter ABI Platform
agorasim-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 283.4 kB

Release files / agorasim-0.0.1.tar.gz

Download URL agorasim-0.0.1.tar.gz
Size 272.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1ef7aa656f6d9fa10ca379238a0d446194c17969bfd6537aff7a340fe1691ebe
BLAKE2b-256 checksum
How to use checksums
4a00b877e62e63970fff6264b8b49220d5d60c78e26d4737d2b809cf6c47c472
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / agorasim-0.0.1-py3-none-any.whl

Download URL agorasim-0.0.1-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
80e21200a6ad8ec6281a36990416624af23c9d3c10b224dd3722969b39bdcbff
BLAKE2b-256 checksum
How to use checksums
aaff3fb9877864372aac23f0ee0bb468c723b562f50009311e9ddfc5e5254bc1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page