{"id":26719303,"url":"https://github.com/santiagocasas/clapp","last_synced_at":"2025-10-10T16:40:02.896Z","repository":{"id":284435232,"uuid":"954932552","full_name":"santiagocasas/clapp","owner":"santiagocasas","description":"CLAPP: CLASS LLM Agent for Pair Programming","archived":false,"fork":false,"pushed_at":"2025-08-01T14:58:32.000Z","size":25046,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-08-01T16:41:40.417Z","etag":null,"topics":["ag2","agentic-ai","ai","class","cosmology","llm","openai-api"],"latest_commit_sha":null,"homepage":"https://classclapp.streamlit.app/","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/santiagocasas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-03-25T20:56:21.000Z","updated_at":"2025-08-01T14:58:36.000Z","dependencies_parsed_at":"2025-05-16T14:32:42.251Z","dependency_job_id":"fa126697-7509-4616-9b5b-e0a66a372d68","html_url":"https://github.com/santiagocasas/clapp","commit_stats":null,"previous_names":["santiagocasas/clapp"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/santiagocasas/clapp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santiagocasas%2Fclapp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santiagocasas%2Fclapp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santiagocasas%2Fclapp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santiagocasas%2Fclapp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/santiagocasas","download_url":"https://codeload.github.com/santiagocasas/clapp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santiagocasas%2Fclapp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279004696,"owners_count":26083750,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["ag2","agentic-ai","ai","class","cosmology","llm","openai-api"],"created_at":"2025-03-27T17:56:42.257Z","updated_at":"2025-10-10T16:40:02.889Z","avatar_url":"https://github.com/santiagocasas.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\ntitle: CLAPP\nemoji: 🚀\ncolorFrom: red\ncolorTo: red\nsdk: docker\napp_port: 8501\ntags:\n- streamlit\npinned: false\nshort_description: 'CLAPP: CLASS LLM Agent for Pair Programming'\nlicense: mit\n---\n\n# CLAPP - CLASS LLM Agent for Pair Programming\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"images/CLAPP.png\" alt=\"CLAPP Logo\" width=\"400\"/\u003e\n\u003c/p\u003e\n\nCLAPP is a Streamlit application that provides an AI pair programming assistant specialized in the [CLASS](https://github.com/lesgourg/class_public) cosmology code. It uses LangChain and OpenAI models, leveraging Retrieval-Augmented Generation (RAG) with CLASS documentation and code examples to provide informed responses and assist with coding tasks.\n\n## Collaborators\n\n* Santiago Casas\n* Christian Fidler\n* Julien Lesgourgues\n* With contributions from: Boris Bolliet \u0026 Francisco Villaescusa-Navarro\n* inspired by the [CAMELS-Agent-App](https://github.com/franciscovillaescusa/CAMELS_Agents)\n\n## Features\n\n* **Conversational AI:** Interact with an AI assistant knowledgeable about [CLASS](https://github.com/lesgourg/class_public) and cosmology.\n* **CLASS Integration:** Built-in tools to install, test, and use the [CLASS](https://github.com/lesgourg/class_public) cosmological code.\n* **Code Execution:** Executes Python code snippets in real-time, with automatic error detection and correction.\n* **Plotting Support:** Generates and displays cosmological plots from [CLASS](https://github.com/lesgourg/class_public) outputs.\n* **RAG Integration:** Retrieves relevant information from [CLASS](https://github.com/lesgourg/class_public) documentation and code (`./class-data/`) to answer questions accurately.\n* **Multiple Response Modes:** \n  * **Fast Mode:** Quick responses with good quality (recommended for most uses)\n  * **Swarm Mode:** Multi-agent refined responses for more complex questions (takes longer)\n* **Secure User Management:** Username-based API key storage allows multiple users to securely save encrypted API keys.\n* **Real-time Feedback:** Streams installation and execution progress in real-time.\n* **Model Selection:** Choose between different OpenAI models (GPT-4o, GPT-4o-mini).\n\n## Setup and Installation\n\nThis project uses conda/mamba for environment management, which is compatible with CLASS installation requirements.\n\n1. **Clone the repository:**\n   ```bash\n   git clone https://github.com/santiagocasas/clapp.git\n   cd clapp\n   ```\n\n2. **Create a conda environment from the environment.yml file:**\n   ```bash\n   # Using conda\n   conda env create -f environment.yml\n   \n   # Or using mamba (faster)\n   mamba env create -f environment.yml\n   ```\n\n3. **Activate the environment:**\n   ```bash\n   conda activate clapp\n   ```\n\n4. **API Key:**\n   * You will need an OpenAI API or Gemini key.\n   * The application allows you to enter a username, API key, and password to encrypt and store it locally.\n   * Keys are saved as `{username}_encrypted_api_key` to allow multiple users.\n   * Get your free Gemini key from https://aistudio.google.com/app/apikey\n\n5. **CLASS Installation:**\n   * CLAPP includes a built-in CLASS installation button that will install CLASS from source.\n   * Alternatively, you can check if CLASS is already installed using the provided tool.\n\n6. **CLASS Data:**\n   * Ensure the `class-data` directory contains the necessary CLASS documentation, code files (.py, .ini, .txt), and potentially PDF documents for the RAG system.\n\n7. **System Prompts:**\n   * Ensure the `prompts/` directory contains the necessary instruction files (`class_instructions.txt`, `review_instructions.txt`, etc.).\n\n## Usage\n\n1. **Activate the conda environment:**\n   ```bash\n   conda activate clapp\n   ```\n\n2. **Run the Streamlit application:**\n   ```bash\n   streamlit run CLAPP.py\n   ```\n\n3. **Setup process:**\n   * Enter your OpenAI API key and optionally a username and password for encryption.\n   * Initialize the application by clicking \"Initialize with Selected Model\".\n   * Check if CLASS is installed or install it using the provided buttons.\n   * Start chatting with the assistant about CLASS-related questions or cosmology code.\n\n4. **Code execution:**\n   * When the assistant provides code, you can execute it by typing \"execute!\" in the chat.\n   * The system will run the code, display the output, and show any generated plots.\n   * If errors occur, the system will automatically attempt to fix them.\n\n## Project Structure\n\n* `CLAPP.py`: The main Streamlit application script.\n* `install_classy.sh`: Script to install CLASS from source.\n* `test_classy.py`: Script to test CLASS installation and functionality.\n* `environment.yml`: Conda environment specification with all required dependencies.\n* `class-data/`: Directory containing data for the RAG system (CLASS code, docs, etc.).\n* `prompts/`: Directory containing system prompts for the AI agents.\n* `images/`: Contains images used in the app interface, including the CLAPP logo.\n* `{username}_encrypted_api_key`: Stores the encrypted OpenAI API keys for each user.\n\n## Working with CLASS\n\nCLAPP allows you to:\n\n1. **Learn about CLASS**: Ask questions about CLASS cosmology code features, parameters, and usage.\n2. **Develop cosmology code**: Get help writing code that uses CLASS for cosmological calculations.\n3. **Debug and fix errors**: Get assistance with error messages and issues in your CLASS code.\n4. **Visualize results**: Generate and view plots of cosmological data.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsantiagocasas%2Fclapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsantiagocasas%2Fclapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsantiagocasas%2Fclapp/lists"}