> For the complete documentation index, see [llms.txt](https://lumore-ai.gitbook.io/lumore.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lumore-ai.gitbook.io/lumore.ai/lumore/about-model-used.md).

# About model used

<figure><img src="/files/5RnbX0pdTUPnu72bt2zq" alt="" width="375"><figcaption></figcaption></figure>

Lumore.ai uses a custom model built on the open-source [Llama 3](https://www.llama.com/) architecture. This model has been fine-tuned and optimized for real-time conversations with complex inputs, allowing it to understand and provide detailed responses about mental health.

```python
import torch
from transformers import LlamaForCausalLM, AutoTokenizer
from llama_recipes.configs import train_config as cfg
from transformers import BitsAndBytesConfig

# Set up the training configuration
cfg.model_name = "meta-llama/Meta-Llama-3.1-8B-Instruct"  # Base model
cfg.num_epochs = 2
cfg.run_validation = False
cfg.gradient_accumulation_steps = 4
cfg.batch_size_training = 1
cfg.lr = 3e-4
cfg.use_fast_kernels = True
cfg.use_fp16 = True
cfg.context_length = 4096
cfg.batching_strategy = "packing"
cfg.output_dir = "Lumo-8B-Instruct"

# Configure model quantization settings
quantization_cfg = BitsAndBytesConfig(load_in_8bit=True)

# Load the pre-trained model with the specified settings
model = LlamaForCausalLM.from_pretrained(
    cfg.model_name,
    device_map="auto",
    quantization_config=quantization_cfg,
    use_cache=False,
    attn_implementation="sdpa" if cfg.use_fast_kernels else None,
    torch_dtype=torch.float16,
)

# Load the tokenizer and configure padding token
tokenizer = AutoTokenizer.from_pretrained(cfg.model_name)
tokenizer.pad_token = tokenizer.eos_token

```

{% tabs %}
{% tab title="Results" %}
Overall Accuracy: 0.92

Accuracy for label Normal: 0.97

Accuracy for label Depression: 0.92

Accuracy for label Anxiety: 0.74

Accuracy for label Bipolar: 0.87
{% endtab %}

{% tab title="Classification report" %}

```
              precision   recall   f1-score   support

  Normal         0.94      0.96      0.95       143
  Depression     0.94      0.93      0.94       115 
  Anxiety        0.80      0.74      0.77       27 
  Bipolar        1.00      0.87      0.93       15
  
  Accuracy                           0.92       300
  Macro avg      0.92      0.87      0.89       300 
  Weighted avg   0.92      0.92      0.92       300
```

{% endtab %}

{% tab title="Confusion Matrix" %}

```
[[139   3   1   0]
 [  5 105   5   0]
 [  6   3  18   0]
 [  1   2   0  12]]
```

{% endtab %}
{% endtabs %}

## Real Time Chat

Lumore.ai offers seamless, live conversations with its AI assistant. Whether you need emotional support, advice, or simply someone to talk to, the model responds in real time, making interactions feel natural and immediate. This real-time capability ensures that users never have to wait long for a reply, making it a truly interactive and engaging experience.

## Scalability

The Lumore.ai model is built for scalability, meaning it can handle a growing number of users without compromising performance. As demand increases, the system can effortlessly manage thousands of concurrent interactions, ensuring consistent, high-quality responses for all users, no matter how many people are using the platform at once. This scalability ensures Lumore.ai can grow alongside its user base.

## Privacy & Securiy

Lumore.ai takes privacy very seriously. All conversations are end-to-end encrypted, ensuring that user data remains completely secure. Furthermore, no personal information or chat history is stored, guaranteeing full anonymity for every user. This commitment to privacy provides a safe and trustworthy space for users to express themselves without worrying about their data being misused.

You can find out more about privacy here:

{% content-ref url="/pages/JjjojIyKxaiBPzzLwvtg" %}
[Privacy](/lumore.ai/lumore/publish-your-docs.md)
{% endcontent-ref %}

The AI assistant learns from each interaction to offer a more personalized experience over time. It tailors its responses based on user preferences, emotional states, and previous conversations, making each interaction feel more relevant and custom-fit. As a result, users receive support that feels uniquely suited to their needs, enhancing the overall experience and making them feel more understood.

## Personalization

The AI assistant learns from each interaction to offer a more personalized experience over time. It tailors its responses based on user preferences, emotional states, and previous conversations, making each interaction feel more relevant and custom-fit. As a result, users receive support that feels uniquely suited to their needs, enhancing the overall experience and making them feel more understood.

You can find out more about Phase 4 here:

{% content-ref url="/pages/kdPITbUFiCmmmnWqGI69" %}
[Phase 4: Personalization](/lumore.ai/lumore/roadmap/phase-4-personalization.md)
{% endcontent-ref %}

## Multi-Language Support

Lumore.ai is designed to be accessible to a global audience. It supports multiple languages, making it easy for users from diverse linguistic backgrounds to engage with the platform. Whether you're speaking English, Spanish, French, or other languages, Lumore.ai can seamlessly understand and respond, breaking down language barriers and allowing more people to benefit from its mental health support.

## Emotional Intelligence

With the integration of neural voice technology, Lumore.ai has the ability to recognize and respond with emotional depth. This means that the AI assistant doesn’t just provide generic answers; it communicates in a way that reflects empathy, warmth, and understanding. The emotional tone of the assistant’s voice is designed to match the context of the conversation, making users feel heard and supported in a more human-like manner.

## Robust Mental Health Focus

The Lumore.ai model is specifically fine-tuned to handle mental health-related conversations. It is equipped to respond thoughtfully to sensitive topics, offering informed and compassionate support for issues like anxiety, depression, and stress. The model is built with mental health expertise in mind, ensuring that users receive valuable assistance during moments of vulnerability.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://lumore-ai.gitbook.io/lumore.ai/lumore/about-model-used.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.
