Skip to content

Commit a84a291

Browse files
committed
added workflow; updated readme
1 parent fdac4ef commit a84a291

File tree

4 files changed

+92
-31
lines changed

4 files changed

+92
-31
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Build and Publish Docker Image on Tag
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build-and-push:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
16+
- name: Set up Docker Buildx
17+
uses: docker/setup-buildx-action@v2
18+
19+
- name: Login to Docker Hub
20+
uses: docker/login-action@v2
21+
with:
22+
username: ${{ secrets.DOCKERHUB_USERNAME }}
23+
password: ${{ secrets.DOCKERHUB_TOKEN }}
24+
25+
- name: Extract metadata (tags, labels) for Docker
26+
id: meta
27+
uses: docker/metadata-action@v4
28+
with:
29+
images: oasis4691/llm-portal
30+
tags: |
31+
type=semver,pattern={{version}}
32+
type=semver,pattern={{major}}.{{minor}}
33+
type=semver,pattern={{major}}
34+
type=ref,event=branch
35+
type=sha
36+
37+
- name: Build and push Docker image
38+
uses: docker/build-push-action@v4
39+
with:
40+
context: .
41+
push: true
42+
tags: ${{ steps.meta.outputs.tags }}
43+
labels: ${{ steps.meta.outputs.labels }}
44+
cache-from: type=gha
45+
cache-to: type=gha,mode=max

README.md

Lines changed: 24 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,38 @@ A FastAPI-based proxy server for Large Language Models (LLMs) that provides a un
1212
- 🖥️ CLI-based admin interface for user management and stats
1313

1414

15-
## Installation, containerized
16-
1. Clone the repository
15+
## Installation
16+
17+
Download docker-compose.yaml
1718
```bash
18-
git clone https://github.com/valaises/llm-proxy.git
19+
wget -O docker-compose.yaml https://raw.githubusercontent.com/valaises/llm-portal/refs/heads/main/docker-compose.yaml
1920
```
2021

21-
use docker compose
22+
Start docker compose
2223
#### Using Docker Compose
2324
```bash
2425
docker compose up -d
2526
```
2627

27-
## Make a Chat Request
28+
## Installation, Development
29+
30+
Clone repository
31+
```sh
32+
git clone https://github.com/valaises/llm-portal.git
33+
```
34+
35+
Start docker compose
36+
```sh
37+
docker compose -f docker-compose-dev.yaml up -d
38+
```
39+
40+
## Example: Make a Chat Request
2841
```bash
29-
curl http://localhost:7012/v1/chat/completions \
42+
curl https://llmproxy.xi.valerii.cc/v1/chat/completions \
3043
-H "Content-Type: application/json" \
31-
-H "Authorization: Bearer $LLM_PROXY_API_KEY" \
44+
-H "Authorization: Bearer admin1234" \
3245
-d '{
33-
"model": "gpt-4.1",
46+
"model": "gemini-2.5-pro",
3447
"messages": [
3548
{
3649
"role": "developer",
@@ -45,21 +58,7 @@ curl http://localhost:7012/v1/chat/completions \
4558
}'
4659
```
4760

48-
49-
## Create a User and API KEY
50-
51-
#### Using CLI Admin
52-
53-
(Docker): start interactive terminal
54-
```bash
55-
docker exec -it llm_proxy bash
56-
```
57-
Start admin CLI
58-
```bash
59-
python -m src.core.scripts.cli_admin
60-
```
61-
62-
#### Using requests
61+
#### Create a User and API KEY Using requests
6362
1. Create a user
6463
```bash
6564
```bash
@@ -87,14 +86,9 @@ You can use DB Viewer to access SQLite DB or use a CLI tool
8786

8887
### CLI Tool Usage
8988

90-
(Docker): start interactive terminal
91-
```bash
92-
docker exec -it llm_proxy bash
93-
```
94-
95-
Execute CLI tool
89+
Execute command
9690
```bash
97-
python -m src.core.scripts.show_usage_stats
91+
docker exec -it llm-portal bash -c "python -m src.core.scripts.show_usage_stats"
9892
```
9993

10094
| User ID | Requests | Tokens In | Tokens Out | Cost In ($) | Cost Out ($) | Messages | Models Used |

docker-compose-example.yaml renamed to docker-compose-dev.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
services:
33
app:
44
build: .
5-
container_name: "llm_proxy"
5+
container_name: "llm-portal"
66
environment:
77
- LLM_PROXY_SECRET="secret"
88
- OPENAI_API_KEY=${OPENAI_API_KEY:-}

docker-compose.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
services:
2+
app:
3+
image: oasis4691/llm-portal:latest
4+
container_name: "llm-portal"
5+
environment:
6+
- LLM_PROXY_SECRET="secret"
7+
- OPENAI_API_KEY=${OPENAI_API_KEY:-}
8+
- GEMINI_API_KEY=${GEMINI_API_KEY:-}
9+
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:-}
10+
- TOGETHERAI_API_KEY=${TOGETHERAI_API_KEY:-}
11+
- OPENROUTER_API_KEY=${OPENROUTER_API_KEY:-}
12+
13+
- ADMIN_EMAIL=${ADMIN_EMAIL:-admin@default.com}
14+
- ADMIN_API_KEY=${ADMIN_API_KEY:-admin1234}
15+
ports:
16+
- "7012:7012"
17+
volumes:
18+
- llm-proxy-db:/app/db
19+
restart: unless-stopped
20+
21+
volumes:
22+
llm-proxy-db:

0 commit comments

Comments
 (0)