Skip to content

Commit

Permalink
livepeer config
Browse files Browse the repository at this point in the history
  • Loading branch information
kyriediculous committed Oct 2, 2024
1 parent 4621af7 commit 6e4efdd
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 18 deletions.
20 changes: 10 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
# Use a base image with Go 1.21.x for pulling the repository and building the application
# Use a base image with Go 1.21.x for building the application
FROM golang:1.21 AS builder

# Set the working directory inside the container
WORKDIR /app

# Copy from local
COPY . .
# Pull the repository
# RUN git clone https://github.com/Livepool-io/livepeer-openai-api-middleware.git .

# Download all the dependencies
RUN go mod download

# Build the Go application
RUN go build -o app
# Build the Go application with CGO disabled and statically linked
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app .

# Use a minimal base image for running the application
FROM debian:bullseye-slim
FROM alpine:latest

# Set the working directory inside the container
WORKDIR /app
# Install ca-certificates
RUN apk --no-cache add ca-certificates

WORKDIR /root/

# Copy the binary from the builder stage
COPY --from=builder /app/app .

# Expose the port the application runs on
EXPOSE 8080

# Set the entry point to run the binary with the gateway flag
ENTRYPOINT ["./app"]
# Set the entry point to run the binary
ENTRYPOINT ["./app"]
11 changes: 4 additions & 7 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
version: '3'

services:
livepeer:
image: livepool/go-livepool:llm
image: livepeer/go-livepeer:v0.7.9-ai.2
networks:
- chatlpt-network
volumes:
- ./lpData:/root/.lpData/keystore
command: >
livepeer -gateway -mainnet -httpAddr 0.0.0.0:8935 -httpIngest -v 6 -ethPassword /root/.lpData/password.txt
- ./lpData:/root/.lpData/
command: '-config /root/.lpData/livepeer.conf'

api:
image: livepool/openai-api:latest
image: livepool/openai-api:llm
networks:
- chatlpt-network
depends_on:
Expand Down
14 changes: 14 additions & 0 deletions lpData/livepeer.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
ethUrl https://arb-mainnet.g.alchemy.com/v2/vMsgfz6xKYg5MTI-o2dhRjrY1J-DlzoG
ethKeystorePath /root/.lpData/keystore
ethPassword /root/.lpData/password.txt
network arbitrum-one-mainnet
gateway true
monitor true
v 99
blockPollingInterval 20
maxPricePerUnit 300
pixelsPerUnit 1
rtmpAddr 0.0.0.0:1935
httpAddr 0.0.0.0:8935
maxTotalEV 100000000000000
maxPricePerCapability /root/.lpData/maxPrices.json
16 changes: 16 additions & 0 deletions lpData/maxPrices.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"capabilities-prices": [
{
"pipeline": "llm",
"model_id": "meta-llama/Meta-Llama-3.1-8B-Instruct",
"price_per_unit": 20000000,
"pixels_per_unit": 1000000
},
{
"pipeline": "llm",
"model_id": "meta-llama/Meta-Llama-3.1-70B-Instruct",
"price_per_unit": 80000000,
"pixels_per_unit": 1000000
}
]
}
11 changes: 10 additions & 1 deletion nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,16 @@ http {

server {
listen 80;
server_name _;
server_name api.chatlpt.ai;
return 301 https://$server_name$request_uri;
}

server {
listen 443 ssl;
server_name api.chatlpt.ai;

ssl_certificate /etc/letsencrypt/live/api.chatlpt.ai/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/api.chatlpt.ai/privkey.pem;

location / {
proxy_pass http://api;
Expand Down

0 comments on commit 6e4efdd

Please sign in to comment.