Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Self-hosted LLM support #661

Open
Mrjaggu opened this issue Mar 1, 2024 · 4 comments
Open

Self-hosted LLM support #661

Mrjaggu opened this issue Mar 1, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@Mrjaggu
Copy link

Mrjaggu commented Mar 1, 2024

Problem

To access our own custom trained LLM model using privatae endpoint hosted on local env.

@Mrjaggu Mrjaggu added the enhancement New feature or request label Mar 1, 2024
Copy link

welcome bot commented Mar 1, 2024

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@dlqqq
Copy link
Member

dlqqq commented Mar 4, 2024

@Mrjaggu Thank you opening this issue! This is already possible if the local LLM supports an "OpenAI-like" API. To do so, you should select any "OpenAI Chat" model, and set the "Base URL" field to localhost and your port number.

If this doesn't meet your use-case however, then please feel free to describe your problem in more detail. For example, what self-hosted LLM services are you trying to use?

@dlqqq dlqqq changed the title Can we add our own hosted custom LLM mode using endpoint Self-hosted LLM support Mar 4, 2024
@dlqqq
Copy link
Member

dlqqq commented Mar 4, 2024

See #389 for existing discussion on using self-hosted LLMs through the strategy I just described.

@DanielCastroBosch
Copy link

It is possible to use a internal LLM in the same network with token provided by MS Entra ?
We have the following steps:

  1. Get the token - Authorization:
    https: //login .microsoftonline.com/< tenant id >/oauth2/v2.0/authorize?response_type=code&client_id=< client id >&scope=< api scope >&redirect_uri=<redirect_uri>

This returns:
https://redirect_uri?code=< code >&session_state=< session_state >

Then:

https://login.microsoftonline.com//oauth2/v2.0/token
Request Body:
grant_type: “authorization_code”
code: “< code generated in the previous step >”
redirect_uri: “<redirect_uri>”
client_id: “<client_id>”
client_secret: “< client secret >”

Step 2 - Get App Context id

POST https://login.microsoftonline.com//oauth2/v2.0/token
Request Body
client_id: “< client id >”
scope: “< api scope >”
client_secret: “< client secret >”
grant_type: “client_credentials”
Response Body
{“token_type”:“Bearer”,“expires_in”:3599,“ext_expires_in”:3599,“access_token”:" < token >"}
  1. Send the message:
POST https://< LLM Server >/api/tryout/v1/public/gpt3/chats/messages
Request Body:
{“messages”:[{“role”:“user”,“content”:“good morning”}],“model”:“gpt3”,“temperature”:0.1}
Response Body:
[{“role”:“assistant”,“content”:“Good morning! How are you today?”,“tokenCount”:17,“tokenLimitExceeded”:false}]

How do I configure Jupyter-Ai assistant to work with that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants