A comprehensive simulation framework for AI research and testing scenarios
Project description
llama-simulator
Llama Simulator (llama-simulator) is a framework within the LlamaSearch AI ecosystem for running simulations. It allows defining simulation environments and agents that interact within those environments, useful for testing algorithms, reinforcement learning, or modeling complex systems.
Key Features
- Simulation Environments: Provides or allows defining various simulation environments (
environments/). - Agent Definitions: Supports creating agents with specific behaviors to operate within environments (
agents/). - Simulation Core: Manages the simulation loop, agent interactions, and environment updates (
core.py). - Command-Line Interface: Offers tools to configure and run simulations via CLI (
cli.py). - Configurable: Allows setting up simulation parameters, environments, agents, and logging (
config.py).
Installation
pip install llama-simulator
# Or install directly from GitHub for the latest version:
# pip install git+https://github.com/llamasearchai/llama-simulator.git
Usage
Command-Line Interface (CLI)
(CLI usage examples for running specific simulations will be added here.)
llama-simulator run --config simulation_config.yaml --environment TradingEnv --agent QLearningAgent
Python Client / Embedding
(Python usage examples for programmatically setting up and running simulations will be added here.)
# Placeholder for Python client usage
# from llama_simulator import SimulationRunner, SimulationConfig
# from my_envs import CustomEnvironment
# from my_agents import HeuristicAgent
# config = SimulationConfig.load("config.yaml")
# runner = SimulationRunner(config)
# # Setup simulation
# environment = CustomEnvironment()
# agent = HeuristicAgent()
# runner.setup(environment, [agent])
# # Run the simulation
# results = runner.run_simulation(steps=1000)
# print(f"Simulation finished. Final score: {results['final_score']}")
Architecture Overview
graph TD
A[User / CLI (cli.py)] --> B{Simulation Core (core.py)};
B -- Loads --> C{Simulation Environment (environments/)};
B -- Loads --> D{Agent(s) (agents/)};
B -- Manages --> E[Simulation Loop];
E -- Updates --> C;
E -- Gets Actions --> D;
D -- Acts On --> C;
C -- Provides State/Reward --> D;
E --> F[Simulation Results / Logs];
G[Configuration (config.py)] -- Configures --> B;
G -- Configures --> C;
G -- Configures --> D;
style B fill:#f9f,stroke:#333,stroke-width:2px
style C fill:#ccf,stroke:#333,stroke-width:1px
style D fill:#ccf,stroke:#333,stroke-width:1px
- Interface: User configures and starts the simulation via the CLI or programmatically.
- Core: Loads the specified environment and agent(s) based on configuration.
- Simulation Loop: The core manages the main loop, stepping through time.
- Interaction: In each step, agents perceive the environment state, decide on actions, and act upon the environment.
- Environment Update: The environment state changes based on agent actions and internal dynamics.
- Results: The simulation produces logs, metrics, or final state information.
- Configuration: Defines the environment, agents, simulation length, parameters, etc.
Configuration
(Details on configuring simulation environments, agent parameters, simulation runtime settings, logging, etc., will be added here.)
Development
Setup
# Clone the repository
git clone https://github.com/llamasearchai/llama-simulator.git
cd llama-simulator
# Install in editable mode with development dependencies
pip install -e ".[dev]"
Testing
pytest tests/
Contributing
Contributions are welcome! Please refer to CONTRIBUTING.md and submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llama_simulation-0.1.0.tar.gz.
File metadata
- Download URL: llama_simulation-0.1.0.tar.gz
- Upload date:
- Size: 52.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a8c1b8299aef4d56fdece5ea6f5b2bf0b39790a35d95669e35e267680ad49d4
|
|
| MD5 |
fc74c8e0f6937791da1f5e48f7ecc080
|
|
| BLAKE2b-256 |
fe4ea7e0d47c5c3ff752795b858d7ac53dbf432348b083f4928e513dac64b20f
|
File details
Details for the file llama_simulation-0.1.0-py3-none-any.whl.
File metadata
- Download URL: llama_simulation-0.1.0-py3-none-any.whl
- Upload date:
- Size: 25.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1324930f82c694a98fbec1454d96123603a152647fb57eb1891a7724b664a8c
|
|
| MD5 |
130ff67dd871965b8facc86ce2ae9695
|
|
| BLAKE2b-256 |
a1cf37a6378255cf243121768d663534476ad85803f7d8c22689f584c5a19761
|