{"id":25527112,"url":"https://github.com/mathis-lambert/api","last_synced_at":"2026-05-08T14:04:25.300Z","repository":{"id":278292241,"uuid":"935042353","full_name":"mathis-lambert/api","owner":"mathis-lambert","description":"This repository hosts the core API infrastructure for my web services, built with Python and FastAPI. It serves essential utilities and functionalities across all my web services, accessible under api.mathislambert.fr. The goal is to provide a robust and scalable backend for various web applications.","archived":false,"fork":false,"pushed_at":"2025-02-19T01:10:05.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-19T02:23:35.685Z","etag":null,"topics":["fastapi","llm","openai","python","qdrant"],"latest_commit_sha":null,"homepage":"https://api.mathislambert.fr","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/mathis-lambert.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}},"created_at":"2025-02-18T20:10:15.000Z","updated_at":"2025-02-19T01:10:08.000Z","dependencies_parsed_at":"2025-02-19T02:35:12.315Z","dependency_job_id":null,"html_url":"https://github.com/mathis-lambert/api","commit_stats":null,"previous_names":["mathis-lambert/api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathis-lambert%2Fapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathis-lambert%2Fapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathis-lambert%2Fapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathis-lambert%2Fapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mathis-lambert","download_url":"https://codeload.github.com/mathis-lambert/api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239742416,"owners_count":19689310,"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","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":["fastapi","llm","openai","python","qdrant"],"created_at":"2025-02-19T22:17:11.455Z","updated_at":"2026-05-08T14:04:25.286Z","avatar_url":"https://github.com/mathis-lambert.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# API Repository\n\nWelcome to the `api` repository! This repository hosts the core API infrastructure for my web services, built using Python 3.13 and FastAPI. The API is designed to serve essential utilities and functionalities across all my web services, accessible under the domain `api.mathislambert.fr`.\n\n## Projet structure\n\n![Diagram GitDiagram](https://github.com/user-attachments/assets/eb1624c1-f0dc-4d41-98d6-01744906c195)\n\n## 🌟 Features\n\n- **FastAPI**: A modern, fast (high-performance) web framework for building APIs with Python 3.13 based on standard Python type hints.\n- **MongoDB**: A NoSQL database used for storing application data, offering flexibility and scalability.\n- **Qdrant**: A vector database used for implementing Retrieval-Augmented Generation (RAG) features, enhancing information retrieval capabilities.\n- **LLM Integration**: OpenAI-compatible chat completions proxied to OpenRouter.\n- **Versioning**: A systematic versioning approach with endpoints like `/v1`, `/v2`, etc., to manage API changes and ensure backward compatibility.\n\n## 🚀 Getting Started\n\n### Prerequisites\n\n- Python 3.13\n- MongoDB instance\n- Qdrant instance\n- OpenRouter API key\n\n### Installation\n\n1. **Clone the Repository**:\n   ```bash\n   git clone https://github.com/your-username/api.git self_api\n   cd self_api\n   ```\n\n2. **Set Up a Virtual Environment**:\n   ```bash\n   python -m venv venv\n   source venv/bin/activate  # On Windows use `venv\\Scripts\\activate`\n   ```\n\n3. **Install Dependencies**:\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n4. **Configure Environment Variables**:\n   Create a `.env` file in the root directory and add the following variables:\n   ```\n   MONGODB_URI=your_mongodb_connection_string\n   QDRANT_URI=your_qdrant_connection_string\n   OPENROUTER_API_KEY=your_openrouter_api_key\n   OPENROUTER_BASE_URL=https://openrouter.ai/api/v1\n   OPENROUTER_SITE_URL=https://your-site.example\n   OPENROUTER_APP_NAME=your-app-name\n   ```\n\n### Running the API\n\nStart the FastAPI server using:\n```bash\nuvicorn main:app --host 0.0.0.0 --port 3001 --reload\n```\n\nThe API will be accessible at `http://127.0.0.1:3001`.\n\n## 🛣️ API Endpoints\n\n### Versioning\n\n- **Base URL**: `https://api.mathislambert.fr`\n- **Versioning Structure**: `/v1`, `/v2`, etc.\n\n### Example Endpoints\n\n- **Health Check**:\n  - `GET /v1/health`: Check the status of the API.\n\n- **LLM Routes**:\n  - `POST /v1/chat/completions`: OpenAI-compatible chat completions proxied to OpenRouter (metadata-only logging to MongoDB).\n  - `POST /v1/responses`: OpenAI-compatible responses proxied to OpenRouter (metadata-only logging to MongoDB).\n\n- **Data Routes**:\n  - `GET /v1/data`: Retrieve data from MongoDB.\n  - `POST /v1/data`: Insert data into MongoDB.\n\n- **RAG Features**:\n  - `POST /v1/rag/query`: Query the Qdrant database for enhanced information retrieval using RAG.\n\n## 🤝 Contributing\n\nContributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request. Let's build something amazing together!\n\n## 📜 License\n\nThis project is licensed under the MIT License. Feel free to explore, modify, and share!\n\n## 📞 Contact\n\nHave questions or want to chat? Feel free to reach out!\n\n- [LinkedIn](https://www.linkedin.com/in/mathis-lambert) 🔗\n\n---\n\nHappy coding! 💻✨\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathis-lambert%2Fapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmathis-lambert%2Fapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathis-lambert%2Fapi/lists"}