You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pages/edge-services/how-to/create-pipeline-lb.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: How to create an Edge Services pipeline for a Load Balancer
3
3
description: This page explains how to configure an Edge Services pipeline on your Load Balancer, enabling a caching service for faster and more efficient delivery.
Copy file name to clipboardExpand all lines: pages/generative-apis/faq.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ Scaleway's Generative APIs provide access to pre-configured, serverless endpoint
16
16
-**Managed Inference**: Allows deployment of curated or custom models with chosen quantization and Instances, offering predictable throughput and enhanced security features like private network isolation and access control. Managed Inference is billed by hourly usage, whether provisioned capacity is receiving traffic or not.
17
17
18
18
### How do I get started with Generative APIs?
19
-
To get started, explore the [Generative APIs Playground](/generative-apis/quickstart/#start-with-the-generative-apis-playground) in the Scaleway console. For application integration, refer to our [Quickstart guide](/generative-apis/quickstart/), which provides step-by-step instructions on accessing, configuring, and using a Generative APIs endpoint.
19
+
To get started, explore the [Generative APIs Playground](/generative-apis/quickstart/#interacting-with-generative-apis-via-the-playground) in the Scaleway console. For application integration, refer to our [Quickstart guide](/generative-apis/quickstart/), which provides step-by-step instructions on accessing, configuring, and using a Generative APIs endpoint.
### Generating embeddings with bge-multilingual-gemma2
52
52
53
-
You can now generate embeddings using the `bge-multilingual-gemma2` model, such as the following example:
53
+
You can now generate embeddings using the `bge-multilingual-gemma2` model, as shown in the following example:
54
54
55
55
```python
56
56
# Generate embeddings using the 'bge-multilingual-gemma2' model
@@ -73,5 +73,5 @@ The following parameters can be adjusted to influence the output of the embeddin
73
73
-**`model`** (string): The specific embedding model to use, find all our [supported models](/generative-apis/reference-content/supported-models).
74
74
75
75
<Messagetype="warning">
76
-
If you encounter an error such as "Forbidden 403" refer to the [API documentation](/generative-apis/api-cli/understanding-errors) for troubleshooting tips.
76
+
If you encounter an error such as `Forbidden 403`, refer to the [API documentation](/generative-apis/api-cli/understanding-errors) for troubleshooting tips.
@@ -15,8 +15,9 @@ Scaleway's Generative APIs service allows users to interact with powerful vision
15
15
</Message>
16
16
17
17
There are several ways to interact with vision models:
18
-
- The Scaleway [console](https://console.scaleway.com) provides a complete [playground](/generative-apis/how-to/query-vision-models/#accessing-the-playground), aiming to test models, adapt parameters, and observe how these changes affect the output in real-time.
19
-
- The [Chat Completions API](https://www.scaleway.com/en/developers/api/generative-apis/#path-chat-completions-create-a-chat-completion).
18
+
19
+
-**Scaleway console playground** The Scaleway [console](https://console.scaleway.com) provides a complete [playground](/generative-apis/quickstart/#interacting-with-generative-apis-via-the-playground) for Generative APIs. This visual interface allows you to test models, adapt query parameters, and observe how these changes affect the output in real-time.
20
+
-**[Chat Completions API](https://www.scaleway.com/en/developers/api/generative-apis/#path-chat-completions-create-a-chat-completion)**: Use the chat completions API to query vision models programatically.
description: Get started with Scaleway Generative APIs for powerful AI-driven content generation. Follow this guide to set up, configure, and make your first API request.
Generative APIs offer seamless access to pre-configured, serverless endpoints of leading AI models.
13
-
No need to configure hardware or deploy your own models.
12
+
Scaleway Generative APIs provide programmatic access to AI models for generating new content, such as text and code.
14
13
15
-
Hosted in European data centers and priced competitively per million tokens used, these APIs enable efficient and scalable integration of AI capabilities into your applications.
14
+
By using our pre-configured, serverless endpoints of leading AI models, you eliminate the need to configure hardware or deploy your own models.
15
+
16
+
Hosted in European data centers and priced competitively per million tokens used, Generative APIs enable efficient and scalable integration of AI capabilities into your applications.
16
17
17
18
<Requirements />
18
19
@@ -21,79 +22,122 @@ Hosted in European data centers and priced competitively per million tokens used
21
22
- A valid [API key](/iam/how-to/create-api-keys/)
22
23
- Python 3.7+ installed on your system
23
24
24
-
## Start with the Generative APIs Playground
25
+
## Interacting with Generative APIs via the playground
26
+
27
+
The Scaleway console provides a web playground for chat-based models hosted on Generative APIs. This allows you to interact with these models via a visual interface, sending your prompt and getting an immediate text-based response.
25
28
26
-
Scaleway provides a web playground for instruct-based models hosted on Generative APIs.
29
+
### How to access the playground
30
+
31
+
1. Navigate to **Generative APIs** under the **AI** section of the [Scaleway console](https://console.scaleway.com/) side menu. The list of available models displays.
27
32
28
-
### Accessing the Playground
29
-
1. Navigate to **Generative APIs** under the **AI** section of the [Scaleway console](https://console.scaleway.com/) side menu. The list of models you can query displays.
30
33
2. Click the name of the chat model you want to try. Alternatively, click <Iconname="more" /> next to the chat model, and click **Try model** in the menu.
31
34
32
35
The web playground displays.
33
36
34
-
### Using the playground
35
-
1. Enter a prompt at the bottom of the page, or use one of the suggested prompts in the conversation area.
36
-
2. Edit the hyperparameters listed on the right column, for example the default temperature for more or less randomness on the outputs.
37
-
3. Switch models at the top of the page, to observe the capabilities of chat models offered via Generative APIs.
38
-
4. Click **View code** to get code snippets configured according to your settings in the playground.
37
+
### How to use the playground
39
38
40
-
## Install the OpenAI Python SDK
39
+
1. Choose a model from the dropdown list at the top of the page.
41
40
42
-
To start using Generative APIs in your code, you can install the OpenAI Python SDK. Run the following command:
41
+
2. Enter a prompt at the bottom of the page, for example `Tell me a joke`.
43
42
44
-
```bash
45
-
pip install openai
46
-
```
43
+
<Messagetype="tip">
44
+
You can also click one of the suggested prompts in the conversation area, such as `Translate text`, `Rewrite email` or `Code a pong game`, to instantly send a pre-prepared prompt and get the model's response.
45
+
</Message>
46
+
47
+
3. Edit the hyperparameters listed on the right column, for example the default temperature for more or less randomness on the model's output.
48
+
49
+
4. Click the send button to send your prompt and view the model's response in the conversation area, for example `Why don’t scientists trust atoms anymore? Because they make up everything!`
50
+
51
+
<Messagetype="tip">
52
+
You can click **View code** next to the model dropdown to get code snippets you can integrate directly into your Python, Javascript and cURL code bases when [querying a model programatically](#interacting-with-generative-apis-programatically). These snippets are configured according to the settings you have entered in the playground.
53
+
</Message>
54
+
55
+
## Interacting with Generative APIs programatically
56
+
57
+
This example shows you how to start using Generative APIs in your Python code, via the OpenAI Python SDK.
58
+
59
+
### How to install the OpenAI Python SDK
47
60
48
61
<Messagetype="tip">
49
62
Ensure Python is installed on your local machine. If you need to install Python, download it from [python.org](https://www.python.org/downloads/).
50
63
</Message>
51
64
52
-
## Configure and set your API key and service URL
65
+
Run the following command:
66
+
67
+
```bash
68
+
pip install openai
69
+
```
70
+
71
+
### How to configure and set your API key and service URL
53
72
54
-
1. Have your [API key](/iam/how-to/create-api-keys/) ready or generate a new one from the Scaleway console.
55
-
2. Use the following code in your Python script:
73
+
1. Have your [Scaleway API key](/iam/how-to/create-api-keys/) ready, or generate a new one from the Scaleway console.
56
74
57
-
```py
58
-
from openai import OpenAI
75
+
2. Add the following code to your Python script:
59
76
60
-
client = OpenAI(
61
-
base_url="https://api.scaleway.ai/v1", # # Scaleway's Generative APIs service URL
62
-
api_key="<SCW_SECRET_KEY>"# Your unique API secret key from Scaleway
63
-
)
64
-
```
77
+
```py
78
+
from openai import OpenAI
65
79
66
-
Make sure that you replace `<SCW_SECRET_KEY>` with the API key obtained from your Scaleway account.
80
+
client = OpenAI(
81
+
base_url="https://api.scaleway.ai/v1", # # Scaleway's Generative APIs service URL
82
+
api_key="<SCW_SECRET_KEY>"# Your unique API secret key from Scaleway
83
+
)
84
+
```
67
85
68
-
<Messagetype="tip">
69
-
It is recommended to store your API keys securely using environment variables or [secret management tools](/secret-manager/) to prevent unauthorized access.
70
-
</Message>
86
+
Make sure that you replace `<SCW_SECRET_KEY>` with the API key obtained from your Scaleway account.
71
87
72
-
## Send your first API request
88
+
<Messagetype="tip">
89
+
We recommend storing your API keys securely using environment variables or [secret management tools](/secret-manager/) to prevent unauthorized access.
90
+
</Message>
73
91
74
-
You are now ready to make your first API request. Below is an example of generating a description of a futuristic city:
92
+
### How to send your first API request
75
93
76
-
```py
77
-
from openai import OpenAI
94
+
After installing OpenAI and adding setting up the client with the base URL and API key, you are now ready to make your first API request.
78
95
79
-
# Initialize the client with your base URL and API key
80
-
client = OpenAI(
81
-
base_url="https://api.scaleway.ai/v1",
82
-
api_key="<SCW_API_KEY>"
83
-
)
96
+
Below is an example for generating a description of a futuristic city.
84
97
85
-
# Create a chat completion for Llama 3.1 8b instruct
86
-
completion = client.chat.completions.create(
87
-
model="llama-3.1-8b-instruct",
88
-
messages=[{"role": "user", "content": "Describe a futuristic city with advanced technology and green energy solutions."}],
89
-
temperature=0.7,
90
-
max_tokens=100
91
-
)
98
+
1. Ensure your code already contains the openai import statement and creation of a configured OpenAI client as [shown above](#how-to-configure-and-set-your-api-key-and-service-url).
92
99
93
-
# Output the result
94
-
print(completion.choices[0].message.content)
95
-
```
100
+
2. Create a chat completion for Llama 3.1 8b instruct by adding the following to your code:
101
+
102
+
```python
103
+
completion = client.chat.completions.create(
104
+
model="llama-3.1-8b-instruct",
105
+
messages=[{"role": "user", "content": "Describe a futuristic city with advanced technology and green energy solutions."}],
106
+
temperature=0.7,
107
+
max_tokens=100
108
+
)
109
+
```
110
+
111
+
3. Output the result by adding the following to your code:
112
+
113
+
```python
114
+
print(completion.choices[0].message.content)
115
+
```
116
+
117
+
<Messagetype="tip">
118
+
The whole code snippet should look like this:
119
+
120
+
```python
121
+
from openai import OpenAI
122
+
123
+
client = OpenAI(
124
+
base_url="https://api.scaleway.ai/v1", # # Scaleway's Generative APIs service URL
125
+
api_key="<SCW_SECRET_KEY>"# Your unique API secret key from Scaleway
126
+
)
127
+
128
+
# Create chat completion
129
+
completion = client.chat.completions.create(
130
+
model="llama-3.1-8b-instruct",
131
+
messages=[{"role": "user", "content": "Describe a futuristic city with advanced technology and green energy solutions."}],
132
+
temperature=0.7,
133
+
max_tokens=100
96
134
135
+
# Output model's response
136
+
print(completion.choices[0].message.content)
137
+
)
138
+
```
139
+
</Message>
140
+
97
141
This very simple example demonstrates how the Chat API can be used to generate creative content based on your prompts.
0 commit comments