{"id":25753650,"url":"https://github.com/noxs1d/action-model","last_synced_at":"2026-04-29T08:34:37.237Z","repository":{"id":279221542,"uuid":"937084627","full_name":"noxs1d/action-model","owner":"noxs1d","description":"FastAPI-based application that integrates GPT-4o-mini to generate, validate, and execute Bash commands inside a controlled Docker environment. Uses LangGraph for state management and supports session-based execution.","archived":false,"fork":false,"pushed_at":"2025-03-10T07:56:22.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-12T17:52:19.821Z","etag":null,"topics":["async","bash-script","docker","fastapi","langgraph","langgraph-python","llm"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/noxs1d.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-02-22T09:48:00.000Z","updated_at":"2025-03-10T07:58:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"802adb38-8024-4286-97fa-9603e3e74f7f","html_url":"https://github.com/noxs1d/action-model","commit_stats":null,"previous_names":["noxs1d/action-model"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/noxs1d/action-model","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noxs1d%2Faction-model","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noxs1d%2Faction-model/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noxs1d%2Faction-model/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noxs1d%2Faction-model/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/noxs1d","download_url":"https://codeload.github.com/noxs1d/action-model/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noxs1d%2Faction-model/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32417961,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T06:29:02.080Z","status":"ssl_error","status_checked_at":"2026-04-29T06:29:00.631Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async","bash-script","docker","fastapi","langgraph","langgraph-python","llm"],"created_at":"2025-02-26T15:19:12.285Z","updated_at":"2026-04-29T08:34:37.220Z","avatar_url":"https://github.com/noxs1d.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Action Model\n\n## Overview\n\nAction Model is a FastAPI-based application that interacts with an LLM (GPT-4o-mini) to generate, validate, and execute Bash commands in a controlled environment. The system uses LangGraph for state management and Docker for script execution.\n\n## Features\n\n🛠 **FastAPI Backend**: Provides an API for handling user queries.\n\n⚡ **Asynchronous Execution**: Uses async/await for non-blocking operations.\n\n🤖 **LLM Integration**: Interacts with GPT-4o-mini to generate and validate Bash commands.\n\n🔍 **Command Validation**: Ensures that generated commands are correct before execution.\n\n🖥 **Bash Script Execution**: Runs validated commands inside a controlled Docker environment.\n\n📜 **Session-Based Communication**: Supports thread-based execution with a session ID.\n\n## File Structure\n\n```\n.\n├── fast.py           # FastAPI application\n├── main.py           # CLI-based interaction\n├── model.py          # LangGraph state management \u0026 LLM interactions\n├── script.py         # Bash script execution logic\n├── templates/        # Prompt templates for LLM\n├── requirements.txt  # Python dependencies\n└── README.md         # Documentation\n```\n\n## Installation \u0026 Usage (Docker)\n\n### Prerequisites\n- Docker (for script execution)\n- OpenAI API Key (required for LLM interactions)\n\n### Steps\n\n1. **Clone the repository**\n   ```bash\n   git clone https://github.com/noxs1d/action-model.git\n   cd action-model\n   ```\n2. **Set up environment variables**\n   ```bash\n   export OPENAI_API_KEY=your_api_key_here\n   ```\n3. **Build the Docker image**\n   ```bash\n   docker build -t action-model .\n   ```\n4. **Run the container**\n   ```bash\n   docker run -p 8000:8000 --env OPENAI_API_KEY=$OPENAI_API_KEY --name action-model action-model\n   ```\n\nThe API will be available at `http://localhost:8000/docs`.\n\n## Future Improvements\n\n- 🛡 **Enhance Security**: Implement command whitelisting to prevent dangerous operations.\n- 🚀 **Improve Async Handling**: Replace blocking `subprocess.run()` with `asyncio.create_subprocess_exec()`.\n- ✅ **Add Unit Tests**: Use `pytest` to ensure API stability.\n- 📊 **Implement Logging**: Improve debugging with structured logs.\n\n\n## Author\n\n[Nurmukhammed](https://github.com/noxs1d)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoxs1d%2Faction-model","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnoxs1d%2Faction-model","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoxs1d%2Faction-model/lists"}