# How-Tos

The <code class="expression">space.vars.ionos\_cloud\_ai\_model\_hub</code> offers powerful AI capabilities to meet various needs. Here are 12 pivotal guides on how you can implement the features of this service:

## Prerequisite: Authentication Tokens

Before using the <code class="expression">space.vars.ionos\_cloud\_ai\_model\_hub</code>, you must authenticate your requests using an authentication token. These tokens ensure secure access and help manage user permissions, ensuring that only authorized users can interact with the service.

**Key Features**

* Tokens are associated with specific IONOS Public Cloud users and grant access to the AI Model Hub.
* Usage and billing are tied to the IONOS Public Cloud contract owner, who is responsible for the associated users.

For detailed instructions on how to generate an IONOS Public Cloud contract, create users, and generate authentication tokens, see [<mark style="color:blue;">Access Management</mark>](/cloud/ai/ai-model-hub/how-tos/access-management.md) guide.

## 1: Rate Limits

To ensure fair usage, maintain system stability, and prevent abuse, the <code class="expression">space.vars.ionos\_cloud\_ai\_model\_hub</code> enforces rate limits on all API requests. This guide introduces the rationale behind these limits, how they are applied, and how to manage your requests effectively within those limits.

**Key Features**

* Understand the purpose of rate limits and how they help ensure fair, secure access to the AI Model Hub.
* Learn how rate limits are applied across different endpoints and request types.
* Get an overview of the current rate limit values and how to work with them effectively.

For detailed overview of rate limiting, see the [<mark style="color:blue;">Rate Limits</mark>](/cloud/ai/ai-model-hub/how-tos/rate-limits.md) guide.

## 2: Text Generation

Text generation models enable advanced language processing tasks, such as content creation, summarization, conversational responses, and question-answering. These models are pre-trained on extensive datasets, enabling high-quality text generation with minimal setup.

**Key features**

* Access open-source Large Language Models (LLMs) through an OpenAI-compatible API.
* Ensure data privacy with processing confined within Germany.

For step-by-step instructions on text generation, see the [<mark style="color:blue;">Text Generation</mark>](/cloud/ai/ai-model-hub/how-tos/text-generation.md) guide.

## 3: Enrich Text with AI-Generated Images

Adding relevant visuals to text, whether on a website, social media, or marketing materials, boosts engagement, and impact. With state-of-the-art <mark style="color:blue;">Text-to-Image models</mark>, you can generate high-quality images from descriptive text prompts.

**Key Learnings**

* Understand the benefits of enriching text with AI-generated images.
* Learn how to craft effective prompts for [<mark style="color:blue;">Text-to-Image models</mark>](/cloud/ai/ai-model-hub/how-tos/image-generation.md).
* Generate photorealistic or stylized images tailored to your needs.

For a step-by-step guide, see [<mark style="color:blue;">Enrich Texts with AI-Generated Images</mark>](/cloud/ai/ai-model-hub/how-tos/enrich-generated-images.md).

## 4: Tool Calling

Tool calling enables AI models to interact with external services and APIs by recognizing when more data or actions are required. This feature allows models to fetch external information or trigger actions through structured requests, helping to extend the model's capabilities beyond its initial training data.

**Key Features**

* Enable AI models to make calls to external tools and services in response to user queries.
* Use JSON schemas to define and structure the tool requests, ensuring precise parameters.
* Seamlessly integrate external APIs for enhanced functionality, such as retrieving real-time data or performing system actions.

For a detailed walkthrough, including an example with a weather application, see the [<mark style="color:blue;">Tool Calling</mark>](/cloud/ai/ai-model-hub/how-tos/tool-calling.md) guide.

## 5: Image Generation

Image generation models allow you to create high-quality, detailed images from descriptive text prompts. These models can be used for applications in creative design, marketing visuals, and more.

**Key features**

* Generate photorealistic or stylized images based on specific prompts.
* Choose from models optimized for authenticity or creative and artistic outputs.

To learn how to implement image generation, see the [<mark style="color:blue;">Image Generation</mark>](/cloud/ai/ai-model-hub/how-tos/image-generation.md) guide.

## 6: Text Embeddings

Embedding models allow you to create numerical representations of texts, which are similar if the texts are semantically similar. These models are ideal for applications like text retrieval, comparison, ranking, and so on.

**Key features**

* Identify texts that answer a query based on semantic similarity between the query and the potential answer.
* Compare texts to determine their semantic closeness or difference.

To learn how to derive embeddings and calculate the similarity of texts, see the [<mark style="color:blue;">Text Embeddings</mark>](/cloud/ai/ai-model-hub/how-tos/text-embeddings.md) guide.

## 7: Reranking

A reranking model takes a query and a list of candidate documents, and assigns each document a relevance score between 0.0 and 1.0. Unlike embedding models, which encode queries and documents independently, a reranker uses a cross-encoder architecture that processes the query and each document together in a single pass. It allows it to model fine-grained semantic relationships between them.

Rerankers are used as the second stage in a two-stage retrieval pipeline. The first stage uses an embedding model to retrieve a broad set of candidates quickly. The reranker then re-scores and reorders those candidates with higher precision. Documents below a relevance threshold can be filtered out before passing results downstream.

The available reranking model also supports multimodal documents, a document can contain text, images, or a combination of both.

**Key features**

* Score and reorder candidate documents by relevance to a query.
* Filter results by relevance score threshold.
* Combine with embedding models and document collections for high-precision RAG pipelines.
* Accept multimodal documents containing text, images, or mixed content.

To learn how to rerank documents and use relevance scores, see the [<mark style="color:blue;">Reranking</mark>](/cloud/ai/ai-model-hub/how-tos/reranking.md) guide.

## 8: Intelligent Document Search with AI

Finding the right document in file storage can be frustrating when you remember the topic but not the exact location. With [<mark style="color:blue;">Retrieval Augmented Generation</mark>](/cloud/ai/ai-model-hub/how-tos/retrieval-augmented-generation.md), AI can help you search smarter by retrieving documents based on their meaning, not just keywords.

**Key Learnings**

* Understand how document collections are used to store documents based on semantic similarity.
* Upload documents to a searchable collection for fast retrieval.
* Improve search accuracy and relevance for user queries.

To optimize your file searches, check out [<mark style="color:blue;">Intelligent Document Search with AI</mark>](/cloud/ai/ai-model-hub/how-tos/semantic-file-search.md).

By leveraging these AI-powered solutions, you can streamline workflows, improve efficiency, and unlock new possibilities for your business. Explore more advanced [<mark style="color:blue;">AI features</mark>](/cloud/ai/ai-model-hub/how-tos.md) today!

## 9: Retrieval Augmented Generation (RAG)

RAG combines the strengths of foundation models and vector databases. It retrieves the most relevant documents from the database and uses them to augment the output of a foundation model. This approach enriches the responses, making them more accurate and context-aware.

**Key features**

* Combine foundation models with more context retrieved from document collections.
* Enhance response accuracy and relevance for user queries.

To learn how to implement Retrieval Augmented Generation, see the [<mark style="color:blue;">Retrieval Augmented Generation</mark>](/cloud/ai/ai-model-hub/how-tos/retrieval-augmented-generation.md) guide.

## 10: Tool Integration

The <code class="expression">space.vars.ionos\_cloud\_ai\_model\_hub</code> can be integrated into third-party tools that support OpenAI-compatible APIs. It allows you to use hosted foundation models for both language and image tasks within existing platforms, without managing infrastructure or model hosting.

**Key features**

* Connect to frontend and development tools using the OpenAI-compatible API.
* Leverage hosted Large Language and text-to-image models in external applications.
* Integrate seamlessly with tools like AnythingLLM to power chat interfaces, document questions and answers, and more.

For detailed guidance on integrating with tools, see the [<mark style="color:blue;">Tool Integration</mark>](/cloud/ai/ai-model-hub/how-tos/tool-integration.md) guide.

## 11: OpenCode Integration

[<mark style="color:blue;">OpenCode</mark>](https://opencode.ai) is a terminal-based AI coding assistant that supports custom model providers. Because the AI Model Hub exposes an OpenAI-compatible API, you can configure OpenCode to use it as a backend and no custom adapter required.

**Key features**

* Connect OpenCode to the AI Model Hub using the `@ai-sdk/openai-compatible` SDK package.
* Choose from multiple Large Language Models for AI-powered coding assistance.
* Configure models directly in the OpenCode JSON configuration file.

For step-by-step setup instructions, see the [<mark style="color:blue;">OpenCode Integration</mark>](/cloud/ai/ai-model-hub/how-tos/opencode-integration.md) guide.

## 12: Optical Character Recognition (OCR)

Optical Character Recognition (OCR) lets you convert documents such as PDFs, scans, and images into clean, structured text using vision-language models. LightOnOCR-2-1B processes images end-to-end and outputs Markdown-formatted text, including LaTeX spans for mathematical notation.

**Key features**

* Extract text from document images, scans, and PDFs through the OpenAI-compatible API.
* Receive structured Markdown output suitable for downstream processing.
* Support for both URL-based and base64-encoded local images.

For a detailed walkthrough, including examples with URL and local images, refer to the [<mark style="color:blue;">OCR</mark>](/cloud/ai/ai-model-hub/how-tos/ocr.md) guide.

## Explore further

These guides will guide you through the basic functionality of the AI Model Hub, providing clear and actionable steps to integrate advanced AI capabilities into your applications.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ionos.com/cloud/ai/ai-model-hub/how-tos.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
