{"id":27789,"library":"gabm","title":"Generative Agent-Based Model","description":"Generative Agent-Based Model (GABM) framework for building agent-based models using LLMs. Current version 0.2.18, requires Python >=3.12. Active development on GitHub.","status":"active","version":"0.2.18","language":"python","source_language":"en","source_url":"https://github.com/compolis/GABM","tags":["agent-based-model","llm","simulation","gabm"],"install":[{"cmd":"pip install gabm","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Correct import for the main model class.","wrong":"","symbol":"Model","correct":"from gabm import Model"},{"note":"Base agent class.","wrong":"","symbol":"Agent","correct":"from gabm import Agent"}],"quickstart":{"code":"import os\nfrom gabm import Model, Agent\n\nclass MyAgent(Agent):\n    def act(self, context):\n        return f\"Agent {self.id} acting on {context}\"\n\nmodel = Model(\n    agents=[MyAgent(id=1), MyAgent(id=2)],\n    llm_api_key=os.environ.get('OPENAI_API_KEY', '')\n)\nmodel.run(steps=3)","lang":"python","description":"Basic usage: define custom agent, create model with agents, run simulation."},"warnings":[{"fix":"Use `from gabm import Agent` instead of `from gabm import LLMAgent`.","message":"In version 0.2.15, `gabm.LLMAgent` was renamed to `gabm.Agent`. Old import will be removed in 0.3.0.","severity":"deprecated","affected_versions":"<=0.2.14"},{"fix":"Always pass `llm_api_key=os.environ.get('OPENAI_API_KEY', '')` or set via argument.","message":"The `Model` constructor requires `llm_api_key` explicitly; it does not read environment variables automatically.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure `act` returns a string, e.g., `return str(...)`.","message":"Agent `act` method must return a string. Returning non-string leads to silent failure.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Run `pip install gabm`. Verify Python version >=3.12.","cause":"Library not installed or installed in wrong environment.","error":"ModuleNotFoundError: No module named 'gabm'"},{"fix":"Provide `llm_api_key` when creating Model: `Model(agents=[], llm_api_key='your-key')`.","cause":"Model expects `llm_api_key` parameter but it was omitted.","error":"TypeError: Model.__init__() missing 1 required positional argument: 'llm_api_key'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}