# Local LLM and Embedding Configuration Issues in Rasa Pro

**URL:** <https://forum.rasa.com/t/local-llm-and-embedding-configuration-issues-in-rasa-pro/63107>\
**Category:** Rasa CALM\
**Created:** [August 22, 2024, 6:24pm UTC](https://forum.rasa.com/t/local-llm-and-embedding-configuration-issues-in-rasa-pro/63107 "2024-08-22T18:24:53Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![dauvannam1804](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/dauvannam1804/32/24343_2.png) [@dauvannam1804](https://forum.rasa.com/u/dauvannam1804)\
**Post date:** [August 22, 2024, 6:24pm UTC](https://forum.rasa.com/t/local-llm-and-embedding-configuration-issues-in-rasa-pro/63107/1 "2024-08-22T18:24:53Z")

</div>

I’m trying to use a local LLM and embeddings from Ollama with Rasa Pro. When I comment out the `OPENAI_API_KEY` in the `.env` file, then train and run the model using the tutorial, I encounter the following error, but the bot still responds:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/3X/2/7/273305ddd8d17e01fe56435ff4c3bd0622e436fb.png)

Additionally, when I train and test with a fake `OPENAI_API_KEY` set to “@@@”, I also get an error, but the bot still responds:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/3X/8/8/881768be1102f005e0ca4927808a6b3bcbf4e758.png)

I’m not sure why these errors are occurring and whether the local embedding is actually being used, or if it’s defaulting to the OpenAI embedding as mentioned in the documentation. Here’s the config I’m using:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/3X/a/a/aaac788c69c405da9ca171da08fd0cf9aa7cc474.png)

Despite the recommendation in this [post](https://forum.rasa.com/t/local-llm-with-rasa-calm/62752/4) not to configure both LLM and embedding for `FlowPolicy`, should I reconfigure as follows?

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/3X/9/5/95bfc4bf44002eb88d5ec076c60b4b14b6302505.png)

---

<div class="post-metadata">

**Author:** ![Sanjukta.bs](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/sanjukta.bs/32/24453_2.png) [@Sanjukta.bs](https://forum.rasa.com/u/Sanjukta.bs)\
**Post date:** [September 11, 2024, 10:33am UTC](https://forum.rasa.com/t/local-llm-and-embedding-configuration-issues-in-rasa-pro/63107/2 "2024-09-11T10:33:08Z")

</div>

Is there any solution to this?

---

<div class="post-metadata">

**Author:** ![Sanjukta.bs](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/sanjukta.bs/32/24453_2.png) [@Sanjukta.bs](https://forum.rasa.com/u/Sanjukta.bs)\
**Post date:** [September 11, 2024, 8:11pm UTC](https://forum.rasa.com/t/local-llm-and-embedding-configuration-issues-in-rasa-pro/63107/3 "2024-09-11T20:11:13Z")

</div>

Hello since you are also using ollama to run models locally, are you getting errors like asynchronous calls while using ollama? I am facing this particular issue and my responses are also very late about 1minute. Is there anything that we can do to fix it?

---

<div class="post-metadata">

**Author:** ![Shashanka](https://avatars.discourse-cdn.com/v4/letter/s/a9a28c/32.png) [@Shashanka](https://forum.rasa.com/u/Shashanka)\
**Post date:** [September 12, 2024, 6:06am UTC](https://forum.rasa.com/t/local-llm-and-embedding-configuration-issues-in-rasa-pro/63107/4 "2024-09-12T06:06:49Z")

</div>

Hey Sanjukta. Whether you were successful connecting the local LLM at least ? I was not able to do that. Can you share your configurations files please and the method through which you are launching the LLM server.

---

<div class="post-metadata">

**Author:** ![Sanjukta.bs](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/sanjukta.bs/32/24453_2.png) [@Sanjukta.bs](https://forum.rasa.com/u/Sanjukta.bs)\
**Post date:** [September 12, 2024, 6:41am UTC](https://forum.rasa.com/t/local-llm-and-embedding-configuration-issues-in-rasa-pro/63107/5 "2024-09-12T06:41:16Z")

</div>

It is giving me errors while running, but atleast training is successful with this config.

```auto
recipe: default.v1
language: en
pipeline:
- name: SingleStepLLMCommandGenerator
  llm:
    type: ollama
    model: llma3model
    api_base: http://localhost:11434
  prompt_template: prompt_templates/time_aware_prompt.jinja2
  flow_retrieval:
    active: false

```

---

<div class="post-metadata">

**Author:** ![Shashanka](https://avatars.discourse-cdn.com/v4/letter/s/a9a28c/32.png) [@Shashanka](https://forum.rasa.com/u/Shashanka)\
**Post date:** [September 12, 2024, 6:59am UTC](https://forum.rasa.com/t/local-llm-and-embedding-configuration-issues-in-rasa-pro/63107/6 "2024-09-12T06:59:31Z")

</div>

Whether it can predict the actions and flow steps with your current config file ?

---

<div class="post-metadata">

**Author:** ![dauvannam1804](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/dauvannam1804/32/24343_2.png) [@dauvannam1804](https://forum.rasa.com/u/dauvannam1804)\
**Post date:** [September 12, 2024, 7:44am UTC](https://forum.rasa.com/t/local-llm-and-embedding-configuration-issues-in-rasa-pro/63107/7 "2024-09-12T07:44:37Z")

</div>

With the current config, my bot is running normally. As for the issue mentioned, I still don’t know how to solve it yet. Regarding running the LLM locally, I just downloaded and followed the source code from [GitHub - ollama/ollama: Get up and running with Llama 3.1, Mistral, Gemma 2, and other large language models.](https://github.com/ollama/ollama).

---

<div class="post-metadata">

**Author:** ![Sanjukta.bs](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/sanjukta.bs/32/24453_2.png) [@Sanjukta.bs](https://forum.rasa.com/u/Sanjukta.bs)\
**Post date:** [September 12, 2024, 8:59am UTC](https://forum.rasa.com/t/local-llm-and-embedding-configuration-issues-in-rasa-pro/63107/8 "2024-09-12T08:59:14Z")

</div>

Hello, are you using ollama inside docker? I am trying it with docker my config is

```auto
recipe: default.v1
language: en
pipeline:
- name: SingleStepLLMCommandGenerator
  llm:
    type: ollama
    model: llma3model
    base_url: http://localhost:11434

  prompt_template: prompt_templates/time_aware_prompt.jinja2
  flow_retrieval:
    active: false

policies:
- name: FlowPolicy
assistant_id: 20240911-121521-recursive-jersey

```

but I keep getting errors like

```auto
(venv) D:\Sanjukta_rasa>rasa inspect
2024-09-12 13:30:49 INFO rasa.tracing.config - No endpoint for tracing type available in endpoints.yml,tracing will not be configured.
2024-09-12 13:31:01 INFO root - Connecting to channel 'rasa.core.channels.development_inspector.DevelopmentInspectInput' which was specified by the '--connector' argument. Any other channels will be ignored. To connect to all given channels, omit the '--connector' argument.
2024-09-12 13:31:02 INFO root - Starting Rasa server on http://0.0.0.0:5005
2024-09-12 13:31:23 INFO rasa.core.processor - Loading model models\20240912-132942-delicious-panel.tar.gz...
2024-09-12 13:31:23 WARNING rasa.dialogue_understanding.generator.llm_based_command_generator - [warning] Disabling flow retrieval can cause issues when there are a large number of flows to be included in the prompt. For moreinformation see:
https://rasa.com/docs/rasa-pro/concepts/dialogue-understanding#how-the-llmcommandgenerator-works event_key=llm_based_command_generator.flow_retrieval.disabled
2024-09-12 13:31:25 INFO root - Rasa server is up and running.
[2024-09-12 13:31:26 +0530] [12816] [INFO] Starting worker [12816]
2024-09-12 13:31:26 INFO sanic.server - Starting worker [12816]
D:\Sanjukta_rasa\venv\lib\site-packages\langchain\llms\ollama.py:164: RuntimeWarning: coroutine 'AsyncCallbackManagerForLLMRun.on_llm_new_token' was never awaited
  run_manager.on_llm_new_token(
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

```

Does that happened to you, or is there something we can do to solve that?

---

<div class="post-metadata">

**Author:** ![Shashanka](https://avatars.discourse-cdn.com/v4/letter/s/a9a28c/32.png) [@Shashanka](https://forum.rasa.com/u/Shashanka)\
**Post date:** [September 12, 2024, 9:28am UTC](https://forum.rasa.com/t/local-llm-and-embedding-configuration-issues-in-rasa-pro/63107/9 "2024-09-12T09:28:28Z")

</div>

I’m not using docker. The errors i had received were because of the embedding model and flow retrieval related.

---

<div class="post-metadata">

**Author:** ![Rhignome](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/rhignome/32/24571_2.png) [@Rhignome](https://forum.rasa.com/u/Rhignome)\
**Post date:** [October 1, 2024, 10:41am UTC](https://forum.rasa.com/t/local-llm-and-embedding-configuration-issues-in-rasa-pro/63107/11 "2024-10-01T10:41:13Z")

</div>

> [@Sanjukta.bs](#):
>
> Hello since you are also using ollama to run models locally, are you getting errors like asynchronous calls while using ollama? I am facing this particular issue and my responses are also very late about 1minute. Is there anything that we can do to fix it?

He understands your frustration with Ollama. He’s experienced similar issues, like asynchronous call errors and delayed responses. It’s a known problem when running models locally. While there’s no perfect fix, you can try updating Ollama or adjusting your system’s resource allocation to see if it helps. Sometimes, reducing the model size or running fewer simultaneous processes can also improve performance. If the problem persists, reaching out to Ollama’s support or checking their forums might provide more tailored solutions[.](https://www.crediblebh.ltd/)
