1.1.2 • Published 9 months ago

@kluai/gateway v1.1.2

Weekly downloads
-
License
ISC
Repository
-
Last release
9 months ago

Klu Gateway

Klu gateway is an OpenAI compatible gateway package. With it you can self host your own OpenAI API that supports the following models:

  • OpenAI
  • Azure OpenAI
  • Perplexity
  • Anthropic
  • Replicate
  • Google (Gemini models)

Installation

To install the gateway simply run the following command:

npm i @kluai/gateway

We support node versions 14+. If you are using an older version of node, please upgrade.

Running on edge

In order to run on edge (Cloudflare for example) you need to copy the cloudflare directory in this repository.

Once you've copied over the code into your own project, create a cloud worker and run the following command:

npm i
wrangler dev

Now you will be able to run this locally. Feel free to tweak the implementation as much as you need and once you are ready to deploy run:

wrangler deploy

Running on cloud

If you'd like to run this into a cloud you can import the OpenAI gateway function like so.

import { OpenAI } from "@kluai/gateway";

export default {
  async fetch(request: Request, context: ExecutionContext) {
    return OpenAI()(request, context);
  },
};

You could run this in a lambda or any other server and you would be ready to handle any number of requests.

For feedback, suggestions or problems feel free to email stefan@klu.ai

1.1.1

9 months ago

1.1.0

9 months ago

1.1.2

9 months ago

1.0.55

1 year ago

1.0.54

1 year ago

1.0.53

1 year ago

1.0.51

1 year ago

1.0.52

1 year ago

1.0.49

1 year ago

1.0.50

1 year ago

1.0.48

1 year ago

1.0.47

1 year ago

1.0.46

1 year ago

1.0.45

1 year ago

1.0.44

1 year ago

1.0.43

1 year ago

1.0.42

1 year ago

1.0.41

1 year ago

1.0.40

1 year ago

1.0.39

1 year ago

1.0.38

1 year ago

1.0.37

1 year ago

1.0.36

1 year ago

1.0.35

1 year ago

1.0.33

1 year ago

1.0.34

1 year ago

1.0.22

1 year ago

1.0.21

1 year ago

1.0.20

1 year ago

1.0.19

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago