Skip to content

Commit 46e6184

Browse files
committed
feat(genapi): add tuto openwebui (#4433)
1 parent 1fcc163 commit 46e6184

File tree

1 file changed

+150
-0
lines changed
  • tutorials/deploy-openwebui-with-generative-apis

1 file changed

+150
-0
lines changed
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
---
2+
meta:
3+
title: Deploying Open WebUI with Scaleway's Generative APIs
4+
description: This guide explains how to deploy Open WebUI with Scaleway's Generative APIs using Docker or Scaleway's Serverless Containers.
5+
content:
6+
h1: Deploying Open WebUI with Scaleway's Generative APIs
7+
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.
8+
tags: open-webui docker scaleway generative-apis
9+
categories:
10+
- generative-apis
11+
dates:
12+
validation: 2025-02-17
13+
posted: 2025-02-17
14+
---
15+
16+
Integrating Scaleway's Generative APIs with Open WebUI allows you to leverage powerful AI models in a user-friendly, self-hosted interface.
17+
Open WebUI is an open-source frontend that simplifies interactions with AI models, providing an intuitive alternative to proprietary AI interfaces.
18+
19+
This tutorial will guide you through:
20+
21+
- Configuring Generative APIs on Scaleway
22+
- Installing Open WebUI locally
23+
- Deploying Open WebUI using Scaleway's Serverless Containers
24+
25+
26+
By the end, you will have a fully functional AI-powered setup.
27+
28+
<Macro id="requirements" />
29+
30+
### Prerequisites
31+
32+
- A Scaleway account logged into the [console](https://console.scaleway.com)
33+
- [Owner](/iam/concepts/#owner) status or appropriate [IAM permissions](/iam/concepts/#permission)
34+
- [Docker](https://docs.docker.com/get-docker/) installed on your system
35+
36+
## Configuring Generative APIs on Scaleway
37+
38+
Scaleway's Generative APIs provide access to advanced AI models via simple API calls. Follow the instructions below to set up Generative APIs
39+
40+
### Creating an API key
41+
42+
1. Log in to the [Scaleway console](https://console.scaleway.com/).
43+
2. Click on your **Organization name** in the top right corner of the console to display the menu.
44+
3. Click **API keys** in the pop-up menu.
45+
4. Click **Generate a New API Key**, provide a name, and store the key securely.
46+
47+
<Message type="tip">
48+
For detailed information about creating API keys, refer to the [how to create API keys documentation](/iam/how-to/create-api-keys/).
49+
</Message>
50+
51+
### Identifying the API endpoint
52+
53+
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:
54+
55+
```
56+
https://api.scaleway.ai/<YOUR_PROJECT_ID>/v1
57+
```
58+
59+
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`.
60+
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**.
61+
62+
<Message type="note">
63+
Refer to our [dedicated documentation](/organizations-and-projects/how-to/create-a-project/) to retrieve your Project ID.
64+
</Message>
65+
66+
## Installing Open WebUI locally
67+
68+
Open WebUI provides an easy-to-use interface for interacting with AI models. The recommended installation method is via Docker.
69+
70+
### Running Open WebUI with Scaleway integration
71+
72+
1. Pull and run the Docker container:
73+
74+
```bash
75+
docker run -p 3000:8080 \
76+
-e OPENAI_API_BASE_URL=https://api.scaleway.ai/<YOUR_PROJECT_ID>/v1 \
77+
-e OPENAI_API_KEY=<YOUR_API_KEY> \
78+
-v open-webui:/app/backend/data \
79+
--name open-webui \
80+
--restart always \
81+
ghcr.io/open-webui/open-webui:main
82+
```
83+
84+
<Message type="note">
85+
Replace `<YOUR_PROJECT_ID>` and `<YOUR_API_KEY>` with your actual values.
86+
</Message>
87+
88+
2. Navigate to `http://localhost:3000` in your browser to access the Open WebUI interface.
89+
90+
3. Click **Sign Up** to create an administrator account.
91+
4. Select a model from the available Scaleway AI models and start interacting.
92+
93+
For more details, refer to the [Open WebUI Quick Start Guide](https://docs.openwebui.com/getting-started/quick-start/).
94+
95+
## Deploying Open WebUI using Scaleway's Serverless Containers (Optional)
96+
97+
For cloud-based deployment, Scaleway's Serverless Containers offer a scalable solution.
98+
99+
### Deploying on Scaleway via the console
100+
101+
1. In the Scaleway console, navigate to **Serverless** > **Containers**.
102+
2. Click **Deploy Container** to display the container creation wizard.
103+
3. Select an external registry and use the `ghcr.io/open-webui/open-webui:main` image.
104+
<Message type="note">
105+
The default port `8080` is used by the `ghcr.io/open-webui/open-webui:main` image, so no further configuration is needed.
106+
</Message>
107+
4. Enter a name for your container and configure its resources.
108+
5. Click **Advanced options** and configure secrets:
109+
- Set `OPENAI_API_BASE_URL` and `OPENAI_API_KEY` with your specific values.
110+
111+
6. Click **Deploy container** to launch deployment. Once deployed, note the provided endpoint to access Open WebUI.
112+
113+
<Message type="note">
114+
Since the Open WebUI default image is around 5 GB size, deployment can take a couple of minutes before being ready.
115+
</Message>
116+
117+
### Deploying on Scaleway using the ClI
118+
119+
#### Ensure you have a Scaleway Serverless Containers namespace
120+
121+
Scaleway Serverless Containers are deployed inside a **namespace**. Run the following command to create a namespace:
122+
123+
```bash
124+
scw container namespace create name=openwebui-ns region=fr-par
125+
```
126+
Run the following command to retrieve the namespace ID:
127+
```bash
128+
scw container namespace list
129+
```
130+
131+
### Create the Serverless Container
132+
133+
Run the following command to create the container with your **Docker image and secret injection**:
134+
135+
```bash
136+
137+
$ scw container container create name=open-webui \
138+
namespace-id=<YOUR_NAMESPACE_ID> \
139+
registry-image="ghcr.io/open-webui/open-webui:main" \
140+
environment-variables.OPENAI_API_BASE_URL="https://api.scaleway.ai/<YOUR_PROJECT_ID>/v1" \
141+
secret-environment-variables.0.key="OPENAI_API_KEY" \
142+
secret-environment-variables.0.value="<YOUR_SECRET_KEY>" \
143+
region=fr-par
144+
```
145+
146+
<Message type="note">
147+
Replace `<YOUR_PROJECT_ID>` and `<YOUR_API_KEY>` with your actual values.
148+
</Message>
149+
150+
For more information, refer to Scaleway's [Serverless Containers documentation](/serverless-containers/).

0 commit comments

Comments
 (0)