> For the complete documentation index, see [llms.txt](https://cleyrop.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cleyrop.gitbook.io/docs/documentation-fr-en/the-factory/utiliser-la-librairie-de-composants-cleyrop.md).

# Use the Cleyrop component library

## Use the Cleyrop pyai component library

The Cleyrop PyAI library provides a set of ready-to-use Python modules to design, enrich, and deploy your own artificial intelligence apps within the platform.

It offers reusable, optimized building blocks to create **chat agents**,  **RAG assistants** or **analytical tools** high-performance.

### Technical documentation

A complete technical documentation is available here:

👉 [py-ai-cleyrop SDK](/docs/documentation-fr-en/support-and-resources/references-techniques-api-sdk/sdk-py-ai-cleyrop.md)

The underlying framework is LangChain, making it possible to orchestrate calls to models, chains, and tools.

👉 See the official documentation: <https://python.langchain.com>

#### Use on the platform

{% hint style="success" %}
The **py\_ai\_cleyrop modules** are natively included in clusters **Python 3.11 and 3.12.**
{% endhint %}

{% hint style="warning" %}
The library is not **available** on the clusters **Python 3.13.**
{% endhint %}

You can use the Python modules directly in a **Python-type Dataflow** (for au**tomated processing** or agent integrations).

You can also use them from **Codelab** (Jupyter notebook) for your t**ests and prototypes**.

{% code title="using ChatModule from the pyai cleyrop library" %}

```python
from py_ai_cleyrop.chat.chat_bot import ChatCleyrop

# Chat model initialization
chat = ChatCleyrop(
    llm_endpoint="http://ai-gen-proxy.cleyrop.svc.cluster.local/llm/cleyrop/v1",
    llm_token="your-api-key",
    model_name="Mistral-Small-3.2-24B-Instruct-2506",
    max_token=512
)

# Simple request
response = chat.invoke("Explain the principle of machine learning in one sentence.")
print(response.content)
```

{% endcode %}

#### Main modules

The components of the Cleyrop library include several specialized modules:

* **Chat Module** — Unified interface for interacting with LLM models (e.g., Mistral, Llama, OVH…).

  Enables text generation, response structuring, streaming, and integration with LangChain.
* **Embeddings Module** — Generation of vector embeddings for semantic search and RAG, compatible with TEI (Text Embeddings Inference).
* **Language Detection Module** — Automatic language detection on multilingual corpora, useful for routing or data preparation.

#### Use cases

The Cleyrop components are designed to **simplify app creation** :

* Build a RAG assistant by combining the module **embeddings** and the **chat.**
* Integrate a conversational LLM into a **Tool**.
* Automate language detection for a corpus before vectorization.
* Create a unified LangChain chain between your **prompts**, **models** and **structured outputs**.
