Openai-api compatible proxy https://liseran.dev
Find a file
Niki Wix Skaarup b27291465e
All checks were successful
Build and push image / docker-build-push-action (push) Successful in 4m15s
openai comp websocket proxying
2026-02-27 12:38:13 +01:00
.forgejo/workflows action 2026-02-10 13:26:45 +01:00
config init 2025-12-15 03:06:30 +01:00
src openai comp websocket proxying 2026-02-27 12:38:13 +01:00
.editorconfig init 2025-12-15 03:06:30 +01:00
.env.template init 2025-12-15 03:06:30 +01:00
.gitignore init 2025-12-15 03:06:30 +01:00
.oxlintrc.json init 2025-12-15 03:06:30 +01:00
.prettierignore init 2025-12-15 03:06:30 +01:00
.prettierrc updated deps and AGENTS.md 2026-02-03 22:10:05 +01:00
AGENTS.md cleaned up code 2026-02-03 23:20:07 +01:00
bun.lock deps 2026-02-27 12:22:43 +01:00
bunfig.toml init 2025-12-15 03:06:30 +01:00
Dockerfile init 2025-12-15 03:06:30 +01:00
package.json deps 2026-02-27 12:22:43 +01:00
README.md openai comp websocket proxying 2026-02-27 12:38:13 +01:00
tsconfig.json init 2025-12-15 03:06:30 +01:00

liseran

openai-api proxy that combines apis into a single api

currently targets being a single endpoint to multiple different vllm instances based on model

WebSocket mode proxying

liseran now supports OpenAI Responses WebSocket mode at /v1/responses.

  • Authenticate the initial upgrade request with Authorization: Bearer <API_KEY>.
  • Send response.create as the first client frame with a model field (or set X-Model on the upgrade request).
  • The proxy selects an upstream for that model and pins the client socket to that backend for the lifetime of the connection.
  • All client and upstream frames are forwarded transparently after routing.
  • If no backend is available for the chosen model, the proxy sends an OpenAI-style error event and closes the socket.

Forgejo multi-arch image build

This repository includes a Forgejo workflow at .forgejo/workflows/docker-build-push-action.yaml.

  • Trigger: push a tag matching v* (for example v1.2.3)
  • Build target: linux/amd64 and linux/arm64
  • Registry: git.skaarup.dev
  • Published tags:
    • git.skaarup.dev/nikiskaarup/liseran:latest
    • git.skaarup.dev/nikiskaarup/liseran:<tag-without-v>

Required repository secret:

  • FORGEJO_PACKAGES_TOKEN_RW (token with package write permissions)

Forgejo runner setup (simple)

This is the simplest setup path and uses the host Docker socket.

  1. Install Docker on the runner host.
  2. Install forgejo-runner.
  3. Register a runner token from Forgejo repository settings and register the runner.
  4. Configure the runner to expose Docker to jobs with container.docker_host: automount.
  5. Run forgejo-runner daemon as a service.

Example runner config (/home/runner/config.yml):

runner:
  capacity: 1

container:
  docker_host: automount

Example registration command (interactive):

forgejo-runner register

When prompted for labels, provide at least one docker label so workflows using runs-on: docker can be scheduled, for example:

docker:docker://node:20-bookworm

The image used by the runner label must include the Docker CLI. If it does not, steps like setup-qemu-action will fail with Unable to locate executable file: docker.

Start the runner:

forgejo-runner daemon --config /home/runner/config.yml

Security note: automount is convenient but gives workflow jobs access to the host Docker daemon. Use only with trusted repositories/users.