Skip to content

Commit 9410237

Browse files
committed
feat(gen-apis): add llamaindex
1 parent 18c9820 commit 9410237

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

pages/generative-apis/reference-content/integrating-generative-apis-with-popular-tools.mdx

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ The following table compares AI tools and libraries supported by Scaleway's Gene
2121
| --- | --- | --- | --- |
2222
| [OpenAI client](#openai-client-libraries) | Popular AI library for natural language processing | Text generation, language translation, text summarization | Low |
2323
| [LangChain](#langchain-rag-and-llm-applications) | Library for building AI applications | Inference, embeddings, document indexing and retrieval | Medium |
24+
| [LlamaIndex](#llamaindex-data-framework) | Framework for building powerful LLM (Large Language Model) applications | Knowledge graph building, document retrieval, data indexing | Medium |
2425
| [Continue Dev](#continue-dev-ai-coding-assistance) | Library for AI-powered coding assistance | Code completion, code review | Low |
2526
| [cURL/Python](#custom-http-integrations) | Direct HTTP API calls for custom integrations | Custom applications, data processing | High |
2627

@@ -71,6 +72,46 @@ LangChain is a popular library for building AI applications. Scaleway's Generati
7172
- [Implementing Retrieval-Augmented Generation (RAG) with LangChain and Scaleway Generative APIs](/tutorials/how-to-implement-rag-generativeapis/)
7273
</Message>
7374

75+
## LlamaIndex data framework
76+
77+
LlamaIndex is an open source is a data framework for building Large Language Models (LLMs) based application. To get started, you'll need to install the LlamaIndex and set up your API key.
78+
79+
### Configuration
80+
81+
To use the LlamaIndex framework with Scaleway's Generative APIs, first install the required dependencies:
82+
83+
```bash
84+
pip install llama-index-llms-openai-like
85+
```
86+
87+
Then set the API key and base URL in your OpenAILike-compatible client:
88+
89+
```python
90+
from llama_index.llms.openai_like import OpenAILike
91+
92+
llm = OpenAILike(
93+
model="pixtral-12b-2409",
94+
api_key="<API secret key>",
95+
api_base="https://api.scaleway.ai/v1",
96+
max_tokens=512,
97+
temperature=0.7,
98+
top_p=1,
99+
presence_penalty=0,
100+
)
101+
```
102+
<Message type="tip">
103+
Make sure to replace `<API secret key>` with your actual API key.
104+
</Message>
105+
106+
### Using LlamaIndex client to chat with the LLM
107+
108+
```python
109+
response = llm.chat([ChatMessage("could you tell about Scaleway please")])
110+
print(response)
111+
```
112+
113+
114+
74115
## Continue Dev (AI coding assistance)
75116

76117
Continue Dev is a library that provides AI-powered coding assistance. Scaleway's Generative APIs support Continue Dev for code completion and more.

0 commit comments

Comments
 (0)