--- title: Quantum-API emoji: ๐Ÿš€ colorFrom: green colorTo: indigo sdk: docker python_version: 3.11 sdk_version: latest suggested_hardware: cpu-basic suggested_storage: small app_file: app.py app_port: 7860 base_path: / fullWidth: true header: default short_description: Quantum-AI API for machine learning and quantum computing. models: - openai-community/gpt2 datasets: - mozilla-foundation/common_voice_13_0 tags: - quantum-ai - machine-learning - fastapi - streamlit - huggingface-spaces - docker thumbnail: >- https://cdn-uploads.huggingface.co/production/uploads/66ee940c0989ae1ac1383839/MseLCVmNge3tBJzqDbN1c.jpeg pinned: true hf_oauth: false disable_embedding: false startup_duration_timeout: 30m custom_headers: cross-origin-embedder-policy: require-corp cross-origin-opener-policy: same-origin cross-origin-resource-policy: cross-origin preload_from_hub: - openai-community/gpt2 config.json license: mit --- # ๐Ÿš€ Quantum-API ## ๐Ÿ”ฌ Overview **Quantum-API** is a hybrid **FastAPI** + **Streamlit** web application that serves as a unified interface for quantum computing tasks. It integrates **PennyLane**, **PyTorch**, and **OpenAI models** via Hugging Face. Optimized for resource-constrained systems and cloud deployments such as Hugging Face Spaces. > โš™๏ธ Quantum-AI API for machine learning and quantum computing, powered by FastAPI, Streamlit, and PennyLane. --- ## โšก Features - ๐Ÿ”— **FastAPI Backend**: RESTful endpoints for quantum ML processing. - ๐Ÿง  **Streamlit Frontend**: Interactive quantum interface on `port 7861`. - ๐Ÿงช **Quantum Computation**: Process quantum logic with PennyLane. - ๐Ÿ“ฆ **Docker & HuggingFace Compatible**: Pre-configured for Spaces deployment. - ๐Ÿ›ก๏ธ **Health Check**: System status endpoint. - โš›๏ธ **Hybrid Quantum-Classical AI**: Combines classical ML with quantum gates. --- ## ๐Ÿ› ๏ธ Installation ### 1. Clone the Repository ```bash git clone https://github.com/subatomicERROR/Quantum-API.git cd Quantum-API ``` ### 2. Create a Virtual Environment (Recommended) ```bash python3 -m venv qvenv source qvenv/bin/activate # For Linux/macOS # OR qvenv\Scripts\activate # For Windows ``` ### 3. Install Requirements ```bash pip install -r requirements.txt ``` --- ## ๐Ÿš€ Running the App Locally ### 1. Start the Backend (FastAPI) ```bash uvicorn api.endpoints.codelama:app --host 0.0.0.0 --port 7860 --reload ``` Accessible at: [http://localhost:7860](http://localhost:7860) ### 2. Start the Frontend (Streamlit) ```bash streamlit run app/app.py --server.port 8000 ``` Accessible at: [http://localhost:8000](http://localhost:8000) --- ## ๐Ÿ”Œ API Endpoints ### ๐ŸŒ Root **GET /** Returns an SEO-optimized HTML homepage. ### โš›๏ธ Quantum Endpoint **POST /quantum-endpoint** **Request Body:** ```json { "data": "your_data_here", "quantum_factor": 1.0 } ``` **Response:** ```json { "status": "success", "quantum_result": "Processed your_data_here with quantum factor 1.0" } ``` ### โค๏ธ Health Check **GET /health** Returns API status. --- ## ๐Ÿ“œ Streamlit Frontend An interactive interface to interact with the quantum backend. ```bash streamlit run app/app.py --server.port 8000 ``` URL: [http://localhost:8000](http://localhost:8000) --- ## ๐Ÿ“ฆ Deployment: Hugging Face Spaces To deploy on Hugging Face: Ensure the following in your repo: - `requirements.txt` - `app/app.py` (Streamlit entrypoint) - `api/endpoints/codelama.py` (FastAPI backend) Use a Docker-based Space with this command in Dockerfile or runtime: ```bash uvicorn api.endpoints.codelama:app --host 0.0.0.0 --port 7860 & \ streamlit run app/app.py --server.port 8000 ``` Push your repo to Hugging Face: ```bash git remote add hf https://huggingface.co./spaces/subatomicERROR/Quantum-API git push hf main ``` --- ## ๐Ÿ“ File Structure ``` Quantum-API/ โ”œโ”€โ”€ api/ โ”‚ โ””โ”€โ”€ endpoints/ โ”‚ โ””โ”€โ”€ codelama.py # FastAPI main app โ”œโ”€โ”€ app/ โ”‚ โ””โ”€โ”€ app.py # Streamlit UI โ”œโ”€โ”€ requirements.txt โ”œโ”€โ”€ README.md โ””โ”€โ”€ .huggingface/README.md # Optional Space ReadMe ``` --- ## ๐Ÿง  Author Built with โ˜• + โš›๏ธ by **subatomicERROR** (Yash R) ๐Ÿ“ง Email: yashramteke55555@gmail.com --- ## ๐Ÿงฌ Branding & Philosophy > Part of the `.ERROR` brand โ€” combining ancient wisdom, futuristic design, and quantum intelligence. This system is part of the **Quantum-AI Stack** including: - **Quantum-ML** โ€” Model & training backend. - **Quantum-API** โ€” This API gateway. - **Quantum-Compute** โ€” Quantum computation engine. --- ## ๐Ÿ“ƒ License **MIT License** --- ๐Ÿช Exploring the quantum realm with AI... ...one entangled bit at a time.