Skip to main content

llama-simulator

PyPI version License Python Version CI Status

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
  1. Interface: User configures and starts the simulation via the CLI or programmatically.
  2. Core: Loads the specified environment and agent(s) based on configuration.
  3. Simulation Loop: The core manages the main loop, stepping through time.
  4. Interaction: In each step, agents perceive the environment state, decide on actions, and act upon the environment.
  5. Environment Update: The environment state changes based on agent actions and internal dynamics.
  6. Results: The simulation produces logs, metrics, or final state information.
  7. 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.

Metadata

Release files for llama-simulation 0.1.0

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

Source distribution (sdist)

Source distribution for llama-simulation 0.1.0
File Size Uploaded
llama_simulation-0.1.0.tar.gz 52.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for llama-simulation 0.1.0
File Interpreter ABI Platform
llama_simulation-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 78.2 kB

Release files / llama_simulation-0.1.0.tar.gz

Download URL llama_simulation-0.1.0.tar.gz
Size 52.9 kB
Tags Source
SHA-256 checksum
How to use checksums
3a8c1b8299aef4d56fdece5ea6f5b2bf0b39790a35d95669e35e267680ad49d4
BLAKE2b-256 checksum
How to use checksums
fe4ea7e0d47c5c3ff752795b858d7ac53dbf432348b083f4928e513dac64b20f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Release files / llama_simulation-0.1.0-py3-none-any.whl

Download URL llama_simulation-0.1.0-py3-none-any.whl
Size 25.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b1324930f82c694a98fbec1454d96123603a152647fb57eb1891a7724b664a8c
BLAKE2b-256 checksum
How to use checksums
a1cf37a6378255cf243121768d663534476ad85803f7d8c22689f584c5a19761
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.1.0 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