Coder Social home page Coder Social logo

Comments (5)

subnetmarco avatar subnetmarco commented on May 26, 2024 3

@agarza22 we are planning to introduce support for streaming in the next minor release of Kong Gateway (3.7).

from kong.

chobits avatar chobits commented on May 26, 2024

This plugin is introduced by #12323,

Hi @tysoekong, could you take a preliminary look at the code, and the non-stream output seems to be as expetect. It seems that the response content in the code is completely rebuilt.

from kong.

agarza22 avatar agarza22 commented on May 26, 2024

@subnetmarco That's great to hear! Do you have a ballpark on when we'll see that release? Does this also mean the ai-proxy plugin will get an update to support the streaming use case?

from kong.

subnetmarco avatar subnetmarco commented on May 26, 2024

@agarza22 in May most likely.

from kong.

ttyS0e avatar ttyS0e commented on May 26, 2024

@agarza22 @chobits Sorry for direct mention, but I see your interest in this feature.

We have added the streaming support, which currently is in review. Code is subject to change slightly.

You can package the streaming-enabled ai-proxy plugin into the existing Kong 3.6.1 image, using (for example) this builder:

FROM kong:3.6.1 as builder

USER root
WORKDIR /builder

RUN apt update && \
    apt install -y zip unzip git

RUN git clone -b 'feat/KAG-4126-ai-proxy-streaming' https://github.com/Kong/kong.git

#---#

FROM kong:3.6.1

USER root

COPY --from=builder --chown=1001:1001 \
     /builder/kong/kong/plugins/ai-proxy \
     /usr/local/share/lua/5.1/kong/plugins/ai-proxy

COPY --from=builder --chown=1001:1001 \
     /builder/kong/kong/llm \
     /usr/local/share/lua/5.1/kong/llm

USER kong

Then you simply add "stream": true to the JSON in your request, and it should print tokens (SSE events) as they are transmitted.

Hope this helps you to start testing it out?

from kong.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.