Back to rankings

Farama-Foundation/HighwayEnv

Pythonhighway-env.farama.org

A collection of environments for autonomous driving and tactical decision-making tasks

reinforcement-learningautonomous-drivinggymnasium-environment
Star Growth
Stars
3.3k
Forks
886
Weekly Growth
โ€”
Issues
37
1k2k3k
Feb 2018Nov 2020Sep 2023Jul 2026
ArtifactsPyPIpip install highwayenv
README

Python PyPI build pre-commit Code style: black


An episode of one of the environments available in HighwayEnv.

A collection of environments for autonomous driving and tactical decision-making tasks. Originally developed by Edouard Leurent and currently maintained by Jin Huang.

The documentation website is at highway-env.farama.org, and we have a public discord server (which we also use to coordinate development work) that you can join here: https://discord.gg/bnJ6kubTg6

Installation

To install HighwayEnv, use:

pip install highway-env

or with uv:

uv add highway-env          # adds to project dependencies and installs (preferred)
uv pip install highway-env  # or install without adding to a project (pip install)

We support Linux and macOS primarily, with Windows support maintained on a best-effort basis.

Environments

HighwayEnv includes 10 driving scenario families: highway, intersection, exit, lane-keeping, merge, parking, racetrack, roundabout, two-way, and u-turn, with several environments also offering fast, continuous-control, connected-lane, multi-agent, generic, large, or oval variants. The full list with descriptions and configuration options is available in the documentation.

Previews
highway highway
merge merge
roundabout roundabout
parking parking
intersection intersection
racetrack racetrack
lane-keeping lane-keeping
two-way two-way
exit exit
u-turn u-turn

Usage

import gymnasium as gym
import highway_env

gym.register_envs(highway_env)

# Initialise the environment
env = gym.make("highway-v0", config={"lanes_count": 3}, render_mode="human")

# Reset the environment to generate the first observation
obs, info = env.reset()
for _ in range(1000):
    # this is where you would insert your policy
    action = env.action_space.sample()

    # step (transition) through the environment with the action
    # receiving the next observation, reward and if the episode has terminated or truncated
    obs, reward, terminated, truncated, info = env.step(action)

    # If the episode has ended then we can reset to start a new episode
    if terminated or truncated:
        obs, info = env.reset()

env.close()

See the documentation for more examples including how to train agents with Stable Baselines3 and Google Colab notebooks. For examples of trained agents (DQN, DDPG, Value Iteration, MCTS), see the Agent Examples page.

Documentation

Read the documentation online.

Development Roadmap

Here is the roadmap for future development work.

Citating

If you use HighwayEnv in your work, please consider citing it with:

@misc{highway-env,
  author = {Leurent, Edouard},
  title = {An Environment for Autonomous Driving Decision-Making},
  year = {2018},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/Farama-Foundation/HighwayEnv}},
}

Publications

A list of publications using HighwayEnv can be found in the documentation.

Related repositories
Developer-Y/cs-video-courses

List of Computer Science courses with video lectures.

computer-sciencealgorithms
82.6k11.4k
unslothai/unsloth

Unsloth is a local UI for training and running Gemma 4, Qwen3.6, DeepSeek, Kimi, GLM and other models.

PythonPyPIApache License 2.0fine-tuningllama
unsloth.ai/docs
68.7k6.2k
labmlai/annotated_deep_learning_paper_implementations

๐Ÿง‘โ€๐Ÿซ 60+ Implementations/tutorials of deep learning papers with side-by-side notes ๐Ÿ“; including transformers (original, xl, switch, feedback, vit, ...), optimizers (adam, adabelief, sophia, ...), gans(cyclegan, stylegan2, ...), ๐ŸŽฎ reinforcement learning (ppo, dqn), capsnet, distillation, ... ๐Ÿง 

PythonPyPIMIT Licensedeep-learningdeep-learning-tutorial
nn.labml.ai
67.2k6.7k
ray-project/ray

Ray is an AI compute engine. Ray consists of a core distributed runtime and a set of AI Libraries for accelerating ML workloads.

PythonPyPIApache License 2.0raydistributed
ray.io
43.3k7.8k
rohitg00/ai-engineering-from-scratch

Learn it. Build it. Ship it for others.

PythonPyPIMIT Licenseagentsai
aiengineeringfromscratch.com
41.6k6.9k
sgl-project/sglang

SGLang is a high-performance serving framework for large language models and multimodal models.

PythonPyPIApache License 2.0cudainference
sglang.io
30.6k7.3k
eugeneyan/applied-ml

๐Ÿ“š Papers & tech blogs by companies sharing their work on data science & machine learning in production.

MIT Licenseapplied-machine-learningproduction
29.9k4k
d2l-ai/d2l-en

Interactive deep learning book with multi-framework code, math, and discussions. Adopted at 500 universities from 70 countries including Stanford, MIT, Harvard, and Cambridge.

PythonPyPIOtherdeep-learningmachine-learning
d2l.ai
29.2k5.1k
AI4Finance-Foundation/FinGPT

FinGPT: Open-Source Financial Large Language Models! Revolutionize ๐Ÿ”ฅ We release the trained model on HuggingFace.

Jupyter NotebookMIT Licensechatgptfinance
fingpt.io
20.9k3k
stefan-jansen/machine-learning-for-trading

Code for Machine Learning for Trading, 3rd edition โ€” from data sourcing to live execution.

Jupyter NotebookMIT Licensemachine-learningtrading
ml4trading.io
20k5.4k
Unity-Technologies/ml-agents

The Unity Machine Learning Agents Toolkit (ML-Agents) is an open-source project that enables games and simulations to serve as environments for training intelligent agents using deep reinforcement learning and imitation learning.

C#Otherreinforcement-learningunity3d
unity.com/products/machine-learning-agents
19.6k4.5k
tensorflow/tensor2tensor

Library of deep learning models and datasets designed to make deep learning more accessible and accelerate ML research.

PythonPyPIApache License 2.0machine-learningmachine-translation
17.4k3.8k