Skip to content

Latest commit

ย 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

title GitHub Learner Env (OpenEnv RL Environment)
emoji ๐Ÿง 
colorFrom blue
colorTo gray
sdk docker
app_port 8000
tags
openenv
reinforcement-learning
github

๐Ÿง  GitHub Learner Environment

A Reinforcement Learning environment built with OpenEnv where an agent learns GitHub skills by selecting repositories in the correct order.

This is NOT a toy echo environment โ€” it simulates:

  • Skill progression ๐Ÿ“ˆ
  • Dependency constraints ๐Ÿ”—
  • Reward optimization ๐ŸŽฏ

๐Ÿš€ What This Project Does

The agent must:

  • Choose repositories
  • Learn skills
  • Respect prerequisites
  • Maximize reward

๐Ÿง  RL Loop

Agent โ†’ selects repo โ†’ Environment updates state โ†’ Reward โ†’ Repeat

๐ŸŽฎ Environment Design

๐Ÿ”น Action

Action(repo_id: int)

๐Ÿ‘‰ Agent selects a repository


๐Ÿ”น Observation

Observation:
  available_repos: List[RepoInfo]
  current_state: State
  reward: float
  done: bool

๐Ÿ”น State

Tracks:

State:
  mastered_skills: List[str]
  step_count: int
  progress_score: float

๐Ÿงฉ Repository Structure

Each repo contains:

RepoInfo:
  id: int
  skill: str
  difficulty: int
  prereqs: List[str]

๐ŸŽฏ Reward Function (IMPORTANT)

Reward is calculated using:

reward =
    +2   (new skill)
    -1   (duplicate skill)
    +1   (prereqs satisfied)
    -1   (wrong order)
    +0.5 * difficulty
    +0.1 * unique_skills

๐Ÿ’ก Example

Scenario Reward
Learn new skill correctly High
Repeat same skill Negative
Skip prerequisites Penalty

๐Ÿ Episode Termination

done = step_count >= 5

๐Ÿงช Grading System (Hackathon Critical ๐Ÿšจ)

โœ” Task 1 โ€” Exploration

unique_skills >= 3

โœ” Task 2 โ€” Dependency Correctness

All skills must follow prerequisites


โœ” Task 3 โ€” Efficiency

progress_score >= 5

๐ŸŽฏ Final Evaluation

env.evaluate()

Returns:

{
  "exploration": 0.0โ€“1.0,
  "dependencies": 0.0โ€“1.0,
  "efficiency": 0.0โ€“1.0
}

๐Ÿค– Inference Script

File: inference.py

This script:

  • Runs the environment
  • Chooses actions (LLM or heuristic)
  • Logs output in required format

๐Ÿ“Š Required Log Format

[START] ...
[STEP] ...
[END] ...

๐Ÿง  Action Strategy

1. LLM-based (if API key present)

Uses:

MODEL_NAME = Qwen/Qwen2.5-72B-Instruct

2. Fallback Strategy

  • Picks repo with:

    • unmet skill
    • satisfied prerequisites
    • highest difficulty

โš™๏ธ Setup

1. Install dependencies

pip install -e .

2. Run environment locally

uvicorn server.app:app --reload

3. Test environment

python server/test.py

4. Run inference

python inference.py

๐Ÿณ Docker

docker build -t github_learner_env-env -f server/Dockerfile .

๐ŸŒ Deploy (Hugging Face)

openenv push

๐Ÿ“ Project Structure

github_learner_env/
โ”‚
โ”œโ”€โ”€ client.py
โ”œโ”€โ”€ models.py
โ”œโ”€โ”€ inference.py   โ† agent logic
โ”œโ”€โ”€ openenv.yaml
โ”‚
โ””โ”€โ”€ server/
    โ”œโ”€โ”€ app.py
    โ”œโ”€โ”€ github_learner_env_environment.py  โ† CORE LOGIC
    โ”œโ”€โ”€ repos.json
    โ””โ”€โ”€ Dockerfile

๐Ÿง  Core Learning Concept

This environment teaches:

  • Sequential decision making
  • Dependency planning
  • Reward optimization

๐Ÿš€ Why This Matters

Unlike simple environments, this project includes:

โœ… Multi-step reasoning โœ… Dependency constraints โœ… Custom reward shaping โœ… Automated grading โœ… LLM + heuristic agent


โš ๏ธ Notes

  • Max steps: 5
  • Max reward normalized to 0โ€“1
  • Works with or without LLM

๐Ÿ”ฅ Future Improvements

  • Add dynamic repo generation
  • Introduce time penalties
  • Multi-agent competition
  • Curriculum learning

๐ŸŽฏ Summary

This is a skill-based RL environment where agents must:

  • Learn efficiently
  • Follow correct order
  • Maximize reward

๐Ÿ’ก Built for Meta PyTorch OpenEnv Hackathon

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages