-
Notifications
You must be signed in to change notification settings - Fork 258
feat(genapi): add tuto openwebui #4433
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
Merged
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
dac487c
feat(genapi): add tuto openwebui
bene2k1 c74e882
feat(genapi): tuto
bene2k1 6e673c0
Update index.mdx
fpagny 7a16269
Apply suggestions from code review
bene2k1 16fed02
Apply suggestions from code review
bene2k1 c03aeda
Apply suggestions from code review
bene2k1 8b0630c
Apply suggestions from code review
bene2k1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
150 changes: 150 additions & 0 deletions
150
tutorials/deploy-openwebui-with-generative-apis/index.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,150 @@ | ||
| --- | ||
| meta: | ||
| title: Deploying Open WebUI with Scaleway's Generative APIs | ||
| description: This guide explains how to deploy Open WebUI with Scaleway's Generative APIs using Docker or Scaleway's Serverless Containers. | ||
| content: | ||
| h1: Deploying Open WebUI with Scaleway's Generative APIs | ||
| paragraph: Learn how to integrate Scaleway's Generative APIs with Open WebUI for a seamless AI-powered experience using Docker or Scaleway's Serverless Containers. | ||
| tags: open-webui docker scaleway generative-apis | ||
| categories: | ||
| - generative-apis | ||
| dates: | ||
| validation: 2025-02-17 | ||
| posted: 2025-02-17 | ||
| --- | ||
|
|
||
| Integrating Scaleway's Generative APIs with Open WebUI allows you to leverage powerful AI models in a user-friendly, self-hosted interface. | ||
| Open WebUI is an open-source frontend that simplifies interactions with AI models, providing an intuitive alternative to proprietary AI interfaces. | ||
|
|
||
| This tutorial will guide you through: | ||
|
|
||
| - Configuring Generative APIs on Scaleway | ||
| - Installing Open WebUI locally | ||
| - Deploying Open WebUI using Scaleway's Serverless Containers | ||
|
|
||
|
|
||
| By the end, you'll have a fully functional AI-powered setup. | ||
bene2k1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| <Macro id="requirements" /> | ||
|
|
||
| ### Prerequisites | ||
|
|
||
| - A Scaleway account logged into the [console](https://console.scaleway.com) | ||
| - [Owner](/iam/concepts/#owner) status or appropriate [IAM permissions](/iam/concepts/#permission) | ||
| - [Docker](https://docs.docker.com/get-docker/) installed on your system | ||
|
|
||
| ## Configuring Generative APIs on Scaleway | ||
|
|
||
| Scaleway's Generative APIs provide access to advanced AI models via simple API calls. Follow the instructions below to set up Generative APIs | ||
|
|
||
| ### Creating an API key | ||
|
|
||
| 1. Log in to the [Scaleway console](https://console.scaleway.com/). | ||
| 2. Click on your **Organization name** in the top right corner of the console to display the menu. | ||
| 3. Click **API keys** in the pop-up menu. | ||
| 4. Click **Generate a New API Key**, provide a name, and store the key securely. | ||
|
|
||
| <Message type="tip"> | ||
| For detailed information about creating API keys, refer to the [how to create API keys documentation](/iam/how-to/create-api-keys/). | ||
| </Message> | ||
|
|
||
| ### Identifying the API endpoint | ||
|
|
||
| Scaleway assigns a unique endpoint for your Generative API access. This can be found in the Generative APIs section of the console. The format typically follows: | ||
|
|
||
| ``` | ||
| https://api.scaleway.ai/<YOUR_PROJECT_ID>/v1 | ||
| ``` | ||
|
|
||
| If you have not created a dedicated Project and are using the `default` Project created with your Scaleway account, you can use the following url: `https://api.scaleway.ai/v1`. | ||
bene2k1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| You can also find the exact URL snippet including your `project_id` by visiting the [Generative API Playground](https://console.scaleway.com/generative-api/models/fr-par/playground) and clicking **View Code**. | ||
|
|
||
| <Message type="note"> | ||
| Refer to our [dedicated documentation](/organizations-and-projects/how-to/create-a-project/) to retrieve your Project ID. | ||
| </Message> | ||
|
|
||
| ## Installing Open WebUI locally | ||
|
|
||
| Open WebUI provides an easy-to-use interface for interacting with AI models. The recommended installation method is via Docker. | ||
|
|
||
| ### Running Open WebUI with Scaleway integration | ||
|
|
||
| 1. Pull and run the Docker container: | ||
|
|
||
| ```bash | ||
| docker run -p 3000:8080 \ | ||
| -e OPENAI_API_BASE_URL=https://api.scaleway.ai/<YOUR_PROJECT_ID>/v1 \ | ||
| -e OPENAI_API_KEY=<YOUR_API_KEY> \ | ||
| -v open-webui:/app/backend/data \ | ||
| --name open-webui \ | ||
| --restart always \ | ||
| ghcr.io/open-webui/open-webui:main | ||
| ``` | ||
|
|
||
| <Message type="note"> | ||
| Replace `<YOUR_PROJECT_ID>` and `<YOUR_API_KEY>` with your actual values. | ||
| </Message> | ||
|
|
||
| 2. Navigate to `http://localhost:3000` in your browser to access the Open WebUI interface. | ||
|
|
||
| 3. Click **Sign Up** to create an administrator account. | ||
| 4. Select a model from the available Scaleway AI models and start interacting. | ||
|
|
||
| For more details, refer to the [Open WebUI Quick Start Guide](https://docs.openwebui.com/getting-started/quick-start/). | ||
|
|
||
| ## Deploying Open WebUI using Scaleway's Serverless Containers (Optional) | ||
|
|
||
| For cloud-based deployment, Scaleway's Serverless Containers offer a scalable solution. | ||
|
|
||
| ### Deploying on Scaleway via the console | ||
|
|
||
| 1. In the Scaleway console, navigate to **Serverless** > **Containers**. | ||
| 2. Click **Deploy Container** to display the container creation wizard. | ||
| 3. Select an external registry and use the `ghcr.io/open-webui/open-webui:main` image. | ||
| <Message type="note"> | ||
| You do not need to configure the port as the default one as `8080` is the one used by the image from `ghcr.io/open-webui/open-webui:main`. | ||
bene2k1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| </Message> | ||
| 4. Enter a name for your container and configure its resources. | ||
| 5. Click **Advanced options** and configure secrets: | ||
| - Set `OPENAI_API_BASE_URL` and `OPENAI_API_KEY` with your specific values. | ||
|
|
||
| 6. Click **Deploy container** to launch deployment. Once deployed, note the provided endpoint to access Open WebUI. | ||
|
|
||
| <Message type="note"> | ||
| Since the Open WebUI default image is around 5GB size, deployment can take a couple of minutes before being ready. | ||
bene2k1 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| </Message> | ||
|
|
||
| ### Deploying on Scaleway using the ClI | ||
|
|
||
| #### Ensure you have a Scaleway Serverless Containers namespace | ||
|
|
||
| Scaleway Serverless Containers are deployed inside a **namespace**. Run the following command to create a namespace: | ||
|
|
||
| ```bash | ||
| scw container namespace create name=openwebui-ns region=fr-par | ||
| ``` | ||
| Run the following command to retrieve the namespace ID: | ||
| ```bash | ||
| scw container namespace list | ||
| ``` | ||
|
|
||
| ### Create the Serverless Container | ||
bene2k1 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| Run the following command to create the container with your **Docker image and secret injection**: | ||
|
|
||
| ```bash | ||
|
|
||
| $ scw container container create name=open-webui \ | ||
| namespace-id=<YOUR_NAMESPACE_ID> \ | ||
| registry-image="ghcr.io/open-webui/open-webui:main" \ | ||
| environment-variables.OPENAI_API_BASE_URL="https://api.scaleway.ai/<YOUR_PROJECT_ID>/v1" \ | ||
| secret-environment-variables.0.key="OPENAI_API_KEY" \ | ||
| secret-environment-variables.0.value="<YOUR_SECRET_KEY>" \ | ||
| region=fr-par | ||
| ``` | ||
|
|
||
| <Message type="note"> | ||
| Replace `<YOUR_PROJECT_ID>` and `<YOUR_API_KEY>` with your actual values. | ||
| </Message> | ||
|
|
||
| For more information, refer to Scaleway's [Serverless Containers documentation](/serverless-containers/). | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.