From e0ac46bca5a19b2c557c9bc8533aadda86c9f617 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Guti=C3=A9rrez?= Date: Fri, 30 Jan 2026 10:17:24 +0100 Subject: [PATCH 1/7] first test --- .drone.yml | 26 ++++++++++++ Dockerfile | 10 +++++ README.md | 114 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 150 insertions(+) create mode 100644 .drone.yml create mode 100644 Dockerfile create mode 100644 README.md diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..ca93fe3 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,26 @@ +--- +kind: pipeline +type: docker +name: default + +steps: +- name: docker image build + image: plugins/docker + settings: + tags: + - latest + repo: docker.gutierrezdequevedo.com/ps/hermes +- name: notify matrix + image: spotlightkid/drone-matrixchat-notify + settings: + homeserver: 'https://grava.work' + roomid: '!wMVeFx6jwwF0TWA18h:grava.work' + userid: '@juanjo:grava.work' + deviceid: 'drone CI' + accesstoken: G66FRa3fG7qNfM4KKoW5wx6TWophvvtF + markdown: 'yes' + template: | + `${DRONE_REPO}` build #${DRONE_BUILD_NUMBER} status: **${DRONE_BUILD_STATUS}** + + [${DRONE_BUILD_LINK}] + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d7c2fb1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM python:3.14-slim + +WORKDIR /app + +COPY . . +RUN pip install --no-cache-dir -r requirements.txt + +EXPOSE 5000 + +CMD ["python", "app.py"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..3c5b0b2 --- /dev/null +++ b/README.md @@ -0,0 +1,114 @@ +# OpenAI Models Viewer + +A web-based interface for browsing and interacting with OpenAI-compatible API endpoints. This application allows you to manage multiple server connections, view available models, and chat with AI models directly from your browser. + +## Features + +- **Multi-Server Management**: Add and manage multiple OpenAI-compatible endpoints +- **Model Discovery**: Browse and view all available models from configured servers +- **Interactive Chat**: Chat directly with AI models through a clean web interface +- **Local Storage**: Securely stores server configurations in browser localStorage +- **Responsive Design**: Works on desktop and mobile devices + +## Project Structure + +``` +├── app.py # Flask backend server +├── requirements.txt # Python dependencies +├── static/ +│ ├── index.html # Main HTML interface +│ ├── script.js # Client-side JavaScript logic +│ └── style.css # Styling and layout +``` + +## Getting Started + +### Prerequisites + +- Python 3.7+ +- pip (Python package manager) + +### Installation + +1. Clone the repository: +```bash +git clone +cd openai-models-viewer +``` + +2. Install Python dependencies: +```bash +pip install -r requirements.txt +``` + +3. Run the application: +```bash +python app.py +``` + +The application will start on `http://localhost:5000` by default. + +### Usage + +1. **Add a Server**: + - Click the gear icon next to the server selector + - Enter a server name (e.g., "OpenAI Production") + - Enter the API endpoint URL (e.g., `https://api.openai.com`) + - Enter your API key + - Click "Add Server" + +2. **View Models**: + - Select a configured server from the dropdown + - Models will automatically load and display + +3. **Chat with Models**: + - Click on any model to open the chat interface + - Type your message and press Enter or click Send + - View the AI's response in real-time + +## Development + +### Running with Custom Port + +```bash +python app.py 8080 +``` + +### Docker Support + +Build and run with Docker: + +```bash +docker build -t openai-models-viewer . +docker run -p 5000:5000 openai-models-viewer +``` + +## API Endpoints + +The application connects to standard OpenAI-compatible endpoints: +- `/models` - List available models +- `/v1/chat/completions` - Chat completion endpoint + +## Security + +- API keys are stored locally in browser localStorage +- All communication happens directly between your browser and the API endpoints +- No server-side storage of sensitive information + +## Contributing + +1. Fork the repository +2. Create your feature branch +3. Commit your changes +4. Push to the branch +5. Open a pull request + +## License + +This project is licensed under the MIT License - see the LICENSE file for details. + +## Acknowledgments + +- Built with Flask (Python web framework) +- Uses modern JavaScript for client-side functionality +- Designed with responsive CSS for cross-device compatibility \ No newline at end of file -- 2.49.1 From 1c94f6910ee276a585ce309bd8f69edef49da6bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Guti=C3=A9rrez?= Date: Fri, 30 Jan 2026 11:06:18 +0100 Subject: [PATCH 2/7] fix address --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index ca93fe3..8702e2f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -9,7 +9,7 @@ steps: settings: tags: - latest - repo: docker.gutierrezdequevedo.com/ps/hermes + repo: docker.gutierrezdequevedo.com/ps/model-viewer - name: notify matrix image: spotlightkid/drone-matrixchat-notify settings: -- 2.49.1 From 943003134e110c9e2d8bb2681a5d1e8a87be56e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Guti=C3=A9rrez?= Date: Fri, 30 Jan 2026 11:07:59 +0100 Subject: [PATCH 3/7] fix dependencies --- .drone.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.drone.yml b/.drone.yml index 8702e2f..84606b9 100644 --- a/.drone.yml +++ b/.drone.yml @@ -10,6 +10,16 @@ steps: tags: - latest repo: docker.gutierrezdequevedo.com/ps/model-viewer + +--- +kind: pipeline +type: docker +name: notification + +depends_on: +- default + +steps: - name: notify matrix image: spotlightkid/drone-matrixchat-notify settings: -- 2.49.1 From 2e343a3ea5cbb3fd0dd4c5f9da1e042179b37509 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Guti=C3=A9rrez?= Date: Fri, 30 Jan 2026 11:47:39 +0100 Subject: [PATCH 4/7] fix server related stuff --- Dockerfile | 4 ++-- app.py | 9 ++++----- requirements.txt | 3 ++- static/index.html | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index d7c2fb1..1421080 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,6 @@ WORKDIR /app COPY . . RUN pip install --no-cache-dir -r requirements.txt -EXPOSE 5000 +EXPOSE 8000 -CMD ["python", "app.py"] +CMD ["python", "-m", "gunicorn", "app:app"] diff --git a/app.py b/app.py index 2454536..ea16a6c 100644 --- a/app.py +++ b/app.py @@ -1,18 +1,17 @@ from flask import Flask, send_from_directory -import os app = Flask(__name__, static_folder='static', static_url_path='/static') + @app.route('/') def index(): return send_from_directory('static', 'index.html') -# Serve static files + @app.route('/') def static_files(filename): return send_from_directory('static', filename) + if __name__ == '__main__': - import sys - port = int(sys.argv[1]) if len(sys.argv) > 1 else 5000 - app.run(debug=True, host='0.0.0.0', port=port) + app.run(debug=True, host='0.0.0.0', port=5000) diff --git a/requirements.txt b/requirements.txt index 5eaf725..f941d23 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ flask -requests \ No newline at end of file +gunicorn +requests diff --git a/static/index.html b/static/index.html index 4a9f90c..804f268 100644 --- a/static/index.html +++ b/static/index.html @@ -4,7 +4,7 @@ OpenAI Models Viewer - +
@@ -91,6 +91,6 @@
- + - \ No newline at end of file + -- 2.49.1 From c23a3dd1d0cea4342262c81f0f2a84e6b11562e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Guti=C3=A9rrez?= Date: Fri, 30 Jan 2026 12:02:55 +0100 Subject: [PATCH 5/7] log to stdout --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1421080..49958f1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,4 +7,4 @@ RUN pip install --no-cache-dir -r requirements.txt EXPOSE 8000 -CMD ["python", "-m", "gunicorn", "app:app"] +CMD ["python", "-m", "gunicorn", "app:app", "--access-logfile", "-"] -- 2.49.1 From 90cc336ec2380adb3870ee024f341e33ba6591c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Guti=C3=A9rrez?= Date: Fri, 30 Jan 2026 12:05:11 +0100 Subject: [PATCH 6/7] bind to ANY address --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 49958f1..c5a6e02 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,4 +7,4 @@ RUN pip install --no-cache-dir -r requirements.txt EXPOSE 8000 -CMD ["python", "-m", "gunicorn", "app:app", "--access-logfile", "-"] +CMD ["python", "-m", "gunicorn", "app:app", "--access-logfile", "-", "-b", "0.0.0.0:8000"] -- 2.49.1 From cf6f4dc9beee78979724ef1a173a013ce356023a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Guti=C3=A9rrez?= Date: Fri, 30 Jan 2026 12:07:48 +0100 Subject: [PATCH 7/7] update docs --- README.md | 84 +------------------------------------------------------ 1 file changed, 1 insertion(+), 83 deletions(-) diff --git a/README.md b/README.md index 3c5b0b2..0015511 100644 --- a/README.md +++ b/README.md @@ -10,77 +10,13 @@ A web-based interface for browsing and interacting with OpenAI-compatible API en - **Local Storage**: Securely stores server configurations in browser localStorage - **Responsive Design**: Works on desktop and mobile devices -## Project Structure - -``` -├── app.py # Flask backend server -├── requirements.txt # Python dependencies -├── static/ -│ ├── index.html # Main HTML interface -│ ├── script.js # Client-side JavaScript logic -│ └── style.css # Styling and layout -``` - -## Getting Started - -### Prerequisites - -- Python 3.7+ -- pip (Python package manager) - -### Installation - -1. Clone the repository: -```bash -git clone -cd openai-models-viewer -``` - -2. Install Python dependencies: -```bash -pip install -r requirements.txt -``` - -3. Run the application: -```bash -python app.py -``` - -The application will start on `http://localhost:5000` by default. - -### Usage - -1. **Add a Server**: - - Click the gear icon next to the server selector - - Enter a server name (e.g., "OpenAI Production") - - Enter the API endpoint URL (e.g., `https://api.openai.com`) - - Enter your API key - - Click "Add Server" - -2. **View Models**: - - Select a configured server from the dropdown - - Models will automatically load and display - -3. **Chat with Models**: - - Click on any model to open the chat interface - - Type your message and press Enter or click Send - - View the AI's response in real-time - -## Development - -### Running with Custom Port - -```bash -python app.py 8080 -``` - ### Docker Support Build and run with Docker: ```bash docker build -t openai-models-viewer . -docker run -p 5000:5000 openai-models-viewer +docker run -p 8000:8000 openai-models-viewer ``` ## API Endpoints @@ -94,21 +30,3 @@ The application connects to standard OpenAI-compatible endpoints: - API keys are stored locally in browser localStorage - All communication happens directly between your browser and the API endpoints - No server-side storage of sensitive information - -## Contributing - -1. Fork the repository -2. Create your feature branch -3. Commit your changes -4. Push to the branch -5. Open a pull request - -## License - -This project is licensed under the MIT License - see the LICENSE file for details. - -## Acknowledgments - -- Built with Flask (Python web framework) -- Uses modern JavaScript for client-side functionality -- Designed with responsive CSS for cross-device compatibility \ No newline at end of file -- 2.49.1