From 1cffd259053c122d7504c270c11a4949e682a779 Mon Sep 17 00:00:00 2001
From: Logan <logan.markewich@live.com>
Date: Tue, 20 Feb 2024 10:27:31 -0600
Subject: [PATCH] fixes, so many fixes [circular import bonanza] (#11032)

---
 .github/workflows/unit_test.yml                     |  2 +-
 docs/examples/pipeline/query_pipeline.ipynb         |  4 ++--
 docs/module_guides/models/llms/usage_custom.md      |  2 +-
 llama-index-core/llama_index/core/__init__.py       |  2 +-
 .../llama_index/core/agent/legacy/react/base.py     |  2 +-
 .../llama_index/core/agent/react/step.py            |  2 +-
 .../llama_index/core/agent/react_multimodal/step.py |  2 +-
 .../llama_index/core/agent/runner/base.py           |  2 +-
 .../llama_index/core/agent/runner/parallel.py       |  2 +-
 llama-index-core/llama_index/core/agent/utils.py    |  4 +---
 .../llama_index/core/{ => base}/llms/base.py        |  0
 .../core/{ => base}/llms/generic_utils.py           |  0
 .../core/chat_engine/condense_plus_context.py       |  2 +-
 .../core/chat_engine/condense_question.py           |  2 +-
 llama-index-core/llama_index/core/llms/custom.py    |  2 +-
 llama-index-core/llama_index/core/llms/llm.py       |  6 +++---
 llama-index-core/llama_index/core/prompts/base.py   |  6 +++---
 llama-index-core/llama_index/core/prompts/utils.py  |  2 +-
 .../llama_index/core/service_context.py             |  2 +-
 llama-index-core/pyproject.toml                     |  2 +-
 .../finetuning/callbacks/finetuning_handler.py      |  2 +-
 .../llama_index/agent/openai/base.py                |  2 +-
 .../llama_index/agent/openai/step.py                |  2 +-
 .../examples/query_pipeline.ipynb                   | 13 ++++++-------
 .../llama_index/embeddings/anyscale/utils.py        |  2 +-
 .../llama_index/embeddings/azure_openai/base.py     |  2 +-
 .../llama_index/embeddings/jinaai/base.py           |  2 +-
 .../llama_index/embeddings/mistralai/base.py        |  2 +-
 .../llama_index/embeddings/openai/utils.py          |  2 +-
 .../llama_index/llms/ai21/base.py                   |  2 +-
 .../llama-index-llms-ai21/tests/test_llms_ai21.py   |  2 +-
 .../llama_index/llms/anthropic/base.py              |  2 +-
 .../tests/test_llms_anthropic.py                    |  2 +-
 .../llama_index/llms/anyscale/base.py               |  2 +-
 .../llama_index/llms/anyscale/utils.py              |  2 +-
 .../tests/test_llms_anyscale.py                     |  2 +-
 .../llama_index/llms/azure_openai/base.py           |  2 +-
 .../tests/test_llms_azure_openai.py                 |  2 +-
 .../llama_index/llms/bedrock/base.py                |  2 +-
 .../llama_index/llms/bedrock/utils.py               |  2 +-
 .../tests/test_llms_bedrock.py                      |  2 +-
 .../tests/test_llms_cohere.py                       |  2 +-
 .../tests/test_llms_dashscope.py                    |  2 +-
 .../llama_index/llms/everlyai/base.py               |  2 +-
 .../tests/test_llms_everlyai.py                     |  2 +-
 .../llama_index/llms/gemini/utils.py                |  2 +-
 .../tests/test_llms_gemini.py                       |  2 +-
 .../tests/test_llms_gradient.py                     |  2 +-
 .../llama_index/llms/huggingface/base.py            |  4 ++--
 .../tests/test_llms_huggingface.py                  |  2 +-
 .../llama_index/llms/konko/base.py                  |  2 +-
 .../llama_index/llms/konko/utils.py                 |  2 +-
 .../llama-index-llms-konko/tests/test_llms_konko.py |  2 +-
 .../llama_index/llms/langchain/base.py              |  2 +-
 .../tests/test_llms_langchain.py                    |  2 +-
 .../llama_index/llms/litellm/base.py                |  2 +-
 .../tests/test_llms_litellm.py                      |  2 +-
 .../llama_index/llms/llama_api/base.py              |  2 +-
 .../tests/test_llms_llama_api.py                    |  2 +-
 .../llama_index/llms/llama_cpp/base.py              |  2 +-
 .../tests/test_llms_llama_cpp.py                    |  2 +-
 .../tests/test_llms_localai.py                      |  2 +-
 .../llama_index/llms/mistralai/base.py              |  2 +-
 .../tests/test_llms_mistral.py                      |  2 +-
 .../tests/test_llms_monsterapi.py                   |  2 +-
 .../llama_index/llms/neutrino/base.py               |  2 +-
 .../tests/test_llms_neutrino.py                     |  2 +-
 .../llama_index/llms/nvidia_tensorrt/base.py        |  6 ++++--
 .../tests/test_llms_nvidia_tensorrt.py              |  2 +-
 .../llama_index/llms/nvidia_triton/base.py          |  4 ++--
 .../tests/test_llms_nvidia_triton.py                |  2 +-
 .../tests/test_llms_ollama.py                       |  2 +-
 .../llama_index/llms/openai_like/base.py            |  2 +-
 .../tests/test_llms_openai_like.py                  |  2 +-
 .../llama_index/llms/openai/base.py                 |  2 +-
 .../llama_index/llms/openai/utils.py                |  2 +-
 .../tests/test_llms_openai.py                       |  2 +-
 .../llama_index/llms/openllm/base.py                |  4 ++--
 .../llama_index/llms/openrouter/base.py             |  2 +-
 .../tests/test_llms_openrouter.py                   |  2 +-
 .../llama-index-llms-palm/tests/test_llms_palm.py   |  2 +-
 .../tests/test_llms_perplexity.py                   |  2 +-
 .../llama_index/llms/portkey/base.py                |  3 ++-
 .../tests/test_llms_portkey.py                      |  2 +-
 .../tests/test_llms_predibase.py                    |  2 +-
 .../llama_index/llms/replicate/base.py              |  2 +-
 .../tests/test_llms_replicate.py                    |  2 +-
 .../tests/test_llms_rungpt.py                       |  2 +-
 .../llama_index/llms/sagemaker_endpoint/base.py     |  2 +-
 .../tests/test_llms_sagemaker_endpoint.py           |  2 +-
 .../tests/test_llms_together.py                     |  2 +-
 .../tests/test_llms_vertex.py                       |  2 +-
 .../llama_index/llms/vllm/base.py                   |  4 ++--
 .../llama-index-llms-vllm/tests/test_llms_vllm.py   |  2 +-
 .../llama_index/llms/watsonx/base.py                |  2 +-
 .../tests/test_llms_watsonx.py                      |  2 +-
 .../tests/test_llms_xinference.py                   |  2 +-
 .../multi_modal_llms/azure_openai/base.py           |  2 +-
 .../llama_index/multi_modal_llms/openai/base.py     |  2 +-
 .../multi_modal_llms/replicate_multi_modal/base.py  |  2 +-
 .../llama_index/multi_modal_llms/replicate/base.py  |  2 +-
 poetry.lock                                         |  8 ++++----
 pyproject.toml                                      |  2 +-
 103 files changed, 122 insertions(+), 122 deletions(-)
 rename llama-index-core/llama_index/core/{ => base}/llms/base.py (100%)
 rename llama-index-core/llama_index/core/{ => base}/llms/generic_utils.py (100%)

diff --git a/.github/workflows/unit_test.yml b/.github/workflows/unit_test.yml
index 68e04c3308..b805eb928b 100644
--- a/.github/workflows/unit_test.yml
+++ b/.github/workflows/unit_test.yml
@@ -11,7 +11,7 @@ env:
 
 jobs:
   test:
-    runs-on: ubuntu-latest-4core
+    runs-on: ubuntu-latest-unit-tester
     strategy:
       # You can use PyPy versions in python-version.
       # For example, pypy-2.7 and pypy-3.8
diff --git a/docs/examples/pipeline/query_pipeline.ipynb b/docs/examples/pipeline/query_pipeline.ipynb
index dbb496330a..9bdecd3dbf 100644
--- a/docs/examples/pipeline/query_pipeline.ipynb
+++ b/docs/examples/pipeline/query_pipeline.ipynb
@@ -982,14 +982,14 @@
     "    OutputKeys,\n",
     ")\n",
     "from typing import Dict, Any\n",
-    "from llama_index.core.llms.llm import BaseLLM\n",
+    "from llama_index.core.llms.llm import LLM\n",
     "from pydantic import Field\n",
     "\n",
     "\n",
     "class RelatedMovieComponent(CustomQueryComponent):\n",
     "    \"\"\"Related movie component.\"\"\"\n",
     "\n",
-    "    llm: BaseLLM = Field(..., description=\"OpenAI LLM\")\n",
+    "    llm: LLM = Field(..., description=\"OpenAI LLM\")\n",
     "\n",
     "    def _validate_component_inputs(\n",
     "        self, input: Dict[str, Any]\n",
diff --git a/docs/module_guides/models/llms/usage_custom.md b/docs/module_guides/models/llms/usage_custom.md
index 742b719cc3..b9a61334ef 100644
--- a/docs/module_guides/models/llms/usage_custom.md
+++ b/docs/module_guides/models/llms/usage_custom.md
@@ -180,7 +180,7 @@ from llama_index.core.llms import (
     CompletionResponseGen,
     LLMMetadata,
 )
-from llama_index.core.llms.base import llm_completion_callback
+from llama_index.core.llms.callbacks import llm_completion_callback
 from llama_index.core import Settings
 
 
diff --git a/llama-index-core/llama_index/core/__init__.py b/llama-index-core/llama_index/core/__init__.py
index 5f1aa3fa6e..9c92b685aa 100644
--- a/llama-index-core/llama_index/core/__init__.py
+++ b/llama-index-core/llama_index/core/__init__.py
@@ -1,6 +1,6 @@
 """Init file of LlamaIndex."""
 
-__version__ = "0.10.7"
+__version__ = "0.10.8.post1"
 
 import logging
 from logging import NullHandler
diff --git a/llama-index-core/llama_index/core/agent/legacy/react/base.py b/llama-index-core/llama_index/core/agent/legacy/react/base.py
index d69593043f..d394772ec6 100644
--- a/llama-index-core/llama_index/core/agent/legacy/react/base.py
+++ b/llama-index-core/llama_index/core/agent/legacy/react/base.py
@@ -34,7 +34,7 @@ from llama_index.core.chat_engine.types import (
     AgentChatResponse,
     StreamingAgentChatResponse,
 )
-from llama_index.core.llms.base import ChatMessage, ChatResponse
+from llama_index.core.base.llms.types import ChatMessage, ChatResponse
 from llama_index.core.llms.llm import LLM
 from llama_index.core.memory.chat_memory_buffer import ChatMemoryBuffer
 from llama_index.core.memory.types import BaseMemory
diff --git a/llama-index-core/llama_index/core/agent/react/step.py b/llama-index-core/llama_index/core/agent/react/step.py
index 9e3cd3f610..69df6ed4dc 100644
--- a/llama-index-core/llama_index/core/agent/react/step.py
+++ b/llama-index-core/llama_index/core/agent/react/step.py
@@ -42,7 +42,7 @@ from llama_index.core.chat_engine.types import (
     AgentChatResponse,
     StreamingAgentChatResponse,
 )
-from llama_index.core.llms.base import ChatMessage, ChatResponse
+from llama_index.core.base.llms.types import ChatMessage, ChatResponse
 from llama_index.core.llms.llm import LLM
 from llama_index.core.memory.chat_memory_buffer import ChatMemoryBuffer
 from llama_index.core.memory.types import BaseMemory
diff --git a/llama-index-core/llama_index/core/agent/react_multimodal/step.py b/llama-index-core/llama_index/core/agent/react_multimodal/step.py
index 1f6a127fee..b25d747cf9 100644
--- a/llama-index-core/llama_index/core/agent/react_multimodal/step.py
+++ b/llama-index-core/llama_index/core/agent/react_multimodal/step.py
@@ -32,7 +32,7 @@ from llama_index.core.chat_engine.types import (
     AGENT_CHAT_RESPONSE_TYPE,
     AgentChatResponse,
 )
-from llama_index.core.llms.base import ChatMessage, ChatResponse
+from llama_index.core.base.llms.types import ChatMessage, ChatResponse
 from llama_index.core.memory.chat_memory_buffer import ChatMemoryBuffer
 from llama_index.core.memory.types import BaseMemory
 from llama_index.core.multi_modal_llms.base import MultiModalLLM
diff --git a/llama-index-core/llama_index/core/agent/runner/base.py b/llama-index-core/llama_index/core/agent/runner/base.py
index b8442a1f15..bfdc17b94b 100644
--- a/llama-index-core/llama_index/core/agent/runner/base.py
+++ b/llama-index-core/llama_index/core/agent/runner/base.py
@@ -23,7 +23,7 @@ from llama_index.core.chat_engine.types import (
     ChatResponseMode,
     StreamingAgentChatResponse,
 )
-from llama_index.core.llms.base import ChatMessage
+from llama_index.core.base.llms.types import ChatMessage
 from llama_index.core.llms.llm import LLM
 from llama_index.core.memory import BaseMemory, ChatMemoryBuffer
 from llama_index.core.memory.types import BaseMemory
diff --git a/llama-index-core/llama_index/core/agent/runner/parallel.py b/llama-index-core/llama_index/core/agent/runner/parallel.py
index 8a145c3841..5c5ae0ace2 100644
--- a/llama-index-core/llama_index/core/agent/runner/parallel.py
+++ b/llama-index-core/llama_index/core/agent/runner/parallel.py
@@ -24,7 +24,7 @@ from llama_index.core.chat_engine.types import (
     ChatResponseMode,
     StreamingAgentChatResponse,
 )
-from llama_index.core.llms.base import ChatMessage
+from llama_index.core.base.llms.types import ChatMessage
 from llama_index.core.llms.llm import LLM
 from llama_index.core.memory import BaseMemory, ChatMemoryBuffer
 from llama_index.core.memory.types import BaseMemory
diff --git a/llama-index-core/llama_index/core/agent/utils.py b/llama-index-core/llama_index/core/agent/utils.py
index 187695079d..0fcb2d0396 100644
--- a/llama-index-core/llama_index/core/agent/utils.py
+++ b/llama-index-core/llama_index/core/agent/utils.py
@@ -1,9 +1,7 @@
 """Agent utils."""
 
-
 from llama_index.core.agent.types import TaskStep
-from llama_index.core.base.llms.types import MessageRole
-from llama_index.core.llms.base import ChatMessage
+from llama_index.core.base.llms.types import ChatMessage, MessageRole
 from llama_index.core.memory import BaseMemory
 
 
diff --git a/llama-index-core/llama_index/core/llms/base.py b/llama-index-core/llama_index/core/base/llms/base.py
similarity index 100%
rename from llama-index-core/llama_index/core/llms/base.py
rename to llama-index-core/llama_index/core/base/llms/base.py
diff --git a/llama-index-core/llama_index/core/llms/generic_utils.py b/llama-index-core/llama_index/core/base/llms/generic_utils.py
similarity index 100%
rename from llama-index-core/llama_index/core/llms/generic_utils.py
rename to llama-index-core/llama_index/core/base/llms/generic_utils.py
diff --git a/llama-index-core/llama_index/core/chat_engine/condense_plus_context.py b/llama-index-core/llama_index/core/chat_engine/condense_plus_context.py
index 605905767d..2013d56bfc 100644
--- a/llama-index-core/llama_index/core/chat_engine/condense_plus_context.py
+++ b/llama-index-core/llama_index/core/chat_engine/condense_plus_context.py
@@ -14,7 +14,7 @@ from llama_index.core.chat_engine.types import (
 from llama_index.core.indices.base_retriever import BaseRetriever
 from llama_index.core.indices.query.schema import QueryBundle
 from llama_index.core.indices.service_context import ServiceContext
-from llama_index.core.llms.generic_utils import messages_to_history_str
+from llama_index.core.base.llms.generic_utils import messages_to_history_str
 from llama_index.core.llms.llm import LLM
 from llama_index.core.memory import BaseMemory, ChatMemoryBuffer
 from llama_index.core.postprocessor.types import BaseNodePostprocessor
diff --git a/llama-index-core/llama_index/core/chat_engine/condense_question.py b/llama-index-core/llama_index/core/chat_engine/condense_question.py
index f802b715b5..31b7d6d9b0 100644
--- a/llama-index-core/llama_index/core/chat_engine/condense_question.py
+++ b/llama-index-core/llama_index/core/chat_engine/condense_question.py
@@ -13,7 +13,7 @@ from llama_index.core.chat_engine.types import (
 )
 from llama_index.core.chat_engine.utils import response_gen_from_query_engine
 from llama_index.core.embeddings.mock_embed_model import MockEmbedding
-from llama_index.core.llms.generic_utils import messages_to_history_str
+from llama_index.core.base.llms.generic_utils import messages_to_history_str
 from llama_index.core.llms.llm import LLM
 from llama_index.core.memory import BaseMemory, ChatMemoryBuffer
 from llama_index.core.prompts.base import BasePromptTemplate, PromptTemplate
diff --git a/llama-index-core/llama_index/core/llms/custom.py b/llama-index-core/llama_index/core/llms/custom.py
index 52bd1c685b..3cadc5d0ce 100644
--- a/llama-index-core/llama_index/core/llms/custom.py
+++ b/llama-index-core/llama_index/core/llms/custom.py
@@ -12,7 +12,7 @@ from llama_index.core.llms.callbacks import (
     llm_chat_callback,
     llm_completion_callback,
 )
-from llama_index.core.llms.generic_utils import (
+from llama_index.core.base.llms.generic_utils import (
     completion_response_to_chat_response,
     stream_completion_response_to_chat_response,
 )
diff --git a/llama-index-core/llama_index/core/llms/llm.py b/llama-index-core/llama_index/core/llms/llm.py
index 658cbb727c..21fd79876a 100644
--- a/llama-index-core/llama_index/core/llms/llm.py
+++ b/llama-index-core/llama_index/core/llms/llm.py
@@ -33,11 +33,11 @@ from llama_index.core.bridge.pydantic import (
     validator,
 )
 from llama_index.core.callbacks import CBEventType, EventPayload
-from llama_index.core.llms.base import BaseLLM
-from llama_index.core.llms.generic_utils import (
+from llama_index.core.base.llms.base import BaseLLM
+from llama_index.core.base.llms.generic_utils import (
     messages_to_prompt as generic_messages_to_prompt,
 )
-from llama_index.core.llms.generic_utils import (
+from llama_index.core.base.llms.generic_utils import (
     prompt_to_messages,
 )
 from llama_index.core.prompts import BasePromptTemplate, PromptTemplate
diff --git a/llama-index-core/llama_index/core/prompts/base.py b/llama-index-core/llama_index/core/prompts/base.py
index 4c3089b0b4..c791076351 100644
--- a/llama-index-core/llama_index/core/prompts/base.py
+++ b/llama-index-core/llama_index/core/prompts/base.py
@@ -34,11 +34,11 @@ from llama_index.core.base.query_pipeline.query import (
     validate_and_convert_stringable,
 )
 from llama_index.core.bridge.pydantic import BaseModel
-from llama_index.core.llms.base import BaseLLM
-from llama_index.core.llms.generic_utils import (
+from llama_index.core.base.llms.base import BaseLLM
+from llama_index.core.base.llms.generic_utils import (
     messages_to_prompt as default_messages_to_prompt,
 )
-from llama_index.core.llms.generic_utils import (
+from llama_index.core.base.llms.generic_utils import (
     prompt_to_messages,
 )
 from llama_index.core.prompts.prompt_type import PromptType
diff --git a/llama-index-core/llama_index/core/prompts/utils.py b/llama-index-core/llama_index/core/prompts/utils.py
index 87a5de0db6..956424f7c3 100644
--- a/llama-index-core/llama_index/core/prompts/utils.py
+++ b/llama-index-core/llama_index/core/prompts/utils.py
@@ -1,7 +1,7 @@
 from string import Formatter
 from typing import List
 
-from llama_index.core.llms.base import BaseLLM
+from llama_index.core.base.llms.base import BaseLLM
 
 
 def get_template_vars(template_str: str) -> List[str]:
diff --git a/llama-index-core/llama_index/core/service_context.py b/llama-index-core/llama_index/core/service_context.py
index 3338d75132..534b9016f3 100644
--- a/llama-index-core/llama_index/core/service_context.py
+++ b/llama-index-core/llama_index/core/service_context.py
@@ -13,7 +13,7 @@ from llama_index.core.service_context_elements.llm_predictor import (
     LLMPredictor,
     BaseLLMPredictor,
 )
-from llama_index.core.llms.base import LLMMetadata
+from llama_index.core.base.llms.types import LLMMetadata
 from llama_index.core.llms.llm import LLM
 from llama_index.core.llms.utils import LLMType, resolve_llm
 from llama_index.core.service_context_elements.llama_logger import LlamaLogger
diff --git a/llama-index-core/pyproject.toml b/llama-index-core/pyproject.toml
index 1d32d01a1d..258e9a3f32 100644
--- a/llama-index-core/pyproject.toml
+++ b/llama-index-core/pyproject.toml
@@ -42,7 +42,7 @@ name = "llama-index-core"
 packages = [{include = "llama_index"}]
 readme = "README.md"
 repository = "https://github.com/run-llama/llama_index"
-version = "0.10.8"
+version = "0.10.8.post1"
 
 [tool.poetry.dependencies]
 SQLAlchemy = {extras = ["asyncio"], version = ">=1.4.49"}
diff --git a/llama-index-finetuning/llama_index/finetuning/callbacks/finetuning_handler.py b/llama-index-finetuning/llama_index/finetuning/callbacks/finetuning_handler.py
index 037df668b9..553bfa593c 100644
--- a/llama-index-finetuning/llama_index/finetuning/callbacks/finetuning_handler.py
+++ b/llama-index-finetuning/llama_index/finetuning/callbacks/finetuning_handler.py
@@ -187,7 +187,7 @@ class GradientAIFineTuningHandler(BaseFinetuningHandler):
         },
         ...
         """
-        from llama_index.core.llms.generic_utils import messages_to_history_str
+        from llama_index.core.base.llms.generic_utils import messages_to_history_str
 
         events_dict = self.get_finetuning_events()
         json_strs = []
diff --git a/llama-index-integrations/agent/llama-index-agent-openai/llama_index/agent/openai/base.py b/llama-index-integrations/agent/llama-index-agent-openai/llama_index/agent/openai/base.py
index e78151575b..b604ecf13e 100644
--- a/llama-index-integrations/agent/llama-index-agent-openai/llama_index/agent/openai/base.py
+++ b/llama-index-integrations/agent/llama-index-agent-openai/llama_index/agent/openai/base.py
@@ -18,7 +18,7 @@ from typing import (
 from llama_index.agent.openai.step import OpenAIAgentWorker
 from llama_index.core.agent.runner.base import AgentRunner
 from llama_index.core.callbacks import CallbackManager
-from llama_index.core.llms.base import ChatMessage
+from llama_index.core.base.llms.types import ChatMessage
 from llama_index.core.llms.llm import LLM
 from llama_index.core.memory.chat_memory_buffer import ChatMemoryBuffer
 from llama_index.core.memory.types import BaseMemory
diff --git a/llama-index-integrations/agent/llama-index-agent-openai/llama_index/agent/openai/step.py b/llama-index-integrations/agent/llama-index-agent-openai/llama_index/agent/openai/step.py
index a6ad958674..08d13368aa 100644
--- a/llama-index-integrations/agent/llama-index-agent-openai/llama_index/agent/openai/step.py
+++ b/llama-index-integrations/agent/llama-index-agent-openai/llama_index/agent/openai/step.py
@@ -28,7 +28,7 @@ from llama_index.core.chat_engine.types import (
     ChatResponseMode,
     StreamingAgentChatResponse,
 )
-from llama_index.core.llms.base import ChatMessage, ChatResponse
+from llama_index.core.base.llms.types import ChatMessage, ChatResponse
 from llama_index.core.llms.llm import LLM
 from llama_index.core.memory import BaseMemory, ChatMemoryBuffer
 from llama_index.core.objects.base import ObjectRetriever
diff --git a/llama-index-integrations/callbacks/llama-index-callbacks-arize-phoenix/examples/query_pipeline.ipynb b/llama-index-integrations/callbacks/llama-index-callbacks-arize-phoenix/examples/query_pipeline.ipynb
index df3bd64306..f1dcf3a4bd 100644
--- a/llama-index-integrations/callbacks/llama-index-callbacks-arize-phoenix/examples/query_pipeline.ipynb
+++ b/llama-index-integrations/callbacks/llama-index-callbacks-arize-phoenix/examples/query_pipeline.ipynb
@@ -937,20 +937,19 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "from llama_index.query_pipeline import (\n",
+    "from llama_index.core.query_pipeline import (\n",
     "    CustomQueryComponent,\n",
-    "    InputKeys,\n",
-    "    OutputKeys,\n",
     ")\n",
+    "from llama_index.core.base.query_pipeline.query import InputKeys, OutputKeys\n",
     "from typing import Dict, Any\n",
-    "from llama_index.llms.llm import BaseLLM\n",
+    "from llama_index.core.llms.llm import LLM\n",
     "from pydantic import Field\n",
     "\n",
     "\n",
     "class RelatedMovieComponent(CustomQueryComponent):\n",
     "    \"\"\"Related movie component.\"\"\"\n",
     "\n",
-    "    llm: BaseLLM = Field(..., description=\"OpenAI LLM\")\n",
+    "    llm: LLM = Field(..., description=\"OpenAI LLM\")\n",
     "\n",
     "    def _validate_component_inputs(self, input: Dict[str, Any]) -> Dict[str, Any]:\n",
     "        \"\"\"Validate component inputs during run_component.\"\"\"\n",
@@ -1080,9 +1079,9 @@
  ],
  "metadata": {
   "kernelspec": {
-   "display_name": "llama_integrations",
+   "display_name": "llama-index-4aB9_5sa-py3.10",
    "language": "python",
-   "name": "llama_integrations"
+   "name": "python3"
   },
   "language_info": {
    "codemirror_mode": {
diff --git a/llama-index-integrations/embeddings/llama-index-embeddings-anyscale/llama_index/embeddings/anyscale/utils.py b/llama-index-integrations/embeddings/llama-index-embeddings-anyscale/llama_index/embeddings/anyscale/utils.py
index 556cbc7ca6..895857cfd0 100644
--- a/llama-index-integrations/embeddings/llama-index-embeddings-anyscale/llama_index/embeddings/anyscale/utils.py
+++ b/llama-index-integrations/embeddings/llama-index-embeddings-anyscale/llama_index/embeddings/anyscale/utils.py
@@ -1,6 +1,6 @@
 from typing import Optional, Tuple
 
-from llama_index.core.llms.generic_utils import get_from_param_or_env
+from llama_index.core.base.llms.generic_utils import get_from_param_or_env
 
 DEFAULT_ANYSCALE_API_BASE = "https://api.endpoints.anyscale.com/v1"
 DEFAULT_ANYSCALE_API_VERSION = ""
diff --git a/llama-index-integrations/embeddings/llama-index-embeddings-azure-openai/llama_index/embeddings/azure_openai/base.py b/llama-index-integrations/embeddings/llama-index-embeddings-azure-openai/llama_index/embeddings/azure_openai/base.py
index fc699fee9f..204c035a9d 100644
--- a/llama-index-integrations/embeddings/llama-index-embeddings-azure-openai/llama_index/embeddings/azure_openai/base.py
+++ b/llama-index-integrations/embeddings/llama-index-embeddings-azure-openai/llama_index/embeddings/azure_openai/base.py
@@ -4,7 +4,7 @@ import httpx
 from llama_index.core.bridge.pydantic import Field, PrivateAttr, root_validator
 from llama_index.core.callbacks.base import CallbackManager
 from llama_index.core.constants import DEFAULT_EMBED_BATCH_SIZE
-from llama_index.core.llms.generic_utils import get_from_param_or_env
+from llama_index.core.base.llms.generic_utils import get_from_param_or_env
 from llama_index.embeddings.openai import (
     OpenAIEmbedding,
     OpenAIEmbeddingMode,
diff --git a/llama-index-integrations/embeddings/llama-index-embeddings-jinaai/llama_index/embeddings/jinaai/base.py b/llama-index-integrations/embeddings/llama-index-embeddings-jinaai/llama_index/embeddings/jinaai/base.py
index f64cb48988..0a8ee4285e 100644
--- a/llama-index-integrations/embeddings/llama-index-embeddings-jinaai/llama_index/embeddings/jinaai/base.py
+++ b/llama-index-integrations/embeddings/llama-index-embeddings-jinaai/llama_index/embeddings/jinaai/base.py
@@ -9,7 +9,7 @@ from llama_index.core.base.embeddings.base import (
 )
 from llama_index.core.bridge.pydantic import Field, PrivateAttr
 from llama_index.core.callbacks.base import CallbackManager
-from llama_index.core.llms.generic_utils import get_from_param_or_env
+from llama_index.core.base.llms.generic_utils import get_from_param_or_env
 
 MAX_BATCH_SIZE = 2048
 
diff --git a/llama-index-integrations/embeddings/llama-index-embeddings-mistralai/llama_index/embeddings/mistralai/base.py b/llama-index-integrations/embeddings/llama-index-embeddings-mistralai/llama_index/embeddings/mistralai/base.py
index 138f78bf58..80c471c7ba 100644
--- a/llama-index-integrations/embeddings/llama-index-embeddings-mistralai/llama_index/embeddings/mistralai/base.py
+++ b/llama-index-integrations/embeddings/llama-index-embeddings-mistralai/llama_index/embeddings/mistralai/base.py
@@ -8,7 +8,7 @@ from llama_index.core.base.embeddings.base import (
 )
 from llama_index.core.bridge.pydantic import PrivateAttr
 from llama_index.core.callbacks.base import CallbackManager
-from llama_index.core.llms.generic_utils import get_from_param_or_env
+from llama_index.core.base.llms.generic_utils import get_from_param_or_env
 
 from mistralai.async_client import MistralAsyncClient
 from mistralai.client import MistralClient
diff --git a/llama-index-integrations/embeddings/llama-index-embeddings-openai/llama_index/embeddings/openai/utils.py b/llama-index-integrations/embeddings/llama-index-embeddings-openai/llama_index/embeddings/openai/utils.py
index 72e909da80..2b9bf4254c 100644
--- a/llama-index-integrations/embeddings/llama-index-embeddings-openai/llama_index/embeddings/openai/utils.py
+++ b/llama-index-integrations/embeddings/llama-index-embeddings-openai/llama_index/embeddings/openai/utils.py
@@ -2,7 +2,7 @@ import logging
 import os
 from typing import Any, Callable, Optional, Tuple, Union
 
-from llama_index.core.llms.generic_utils import get_from_param_or_env
+from llama_index.core.base.llms.generic_utils import get_from_param_or_env
 from tenacity import (
     before_sleep_log,
     retry,
diff --git a/llama-index-integrations/llms/llama-index-llms-ai21/llama_index/llms/ai21/base.py b/llama-index-integrations/llms/llama-index-llms-ai21/llama_index/llms/ai21/base.py
index 3805e5d53e..4e290bb962 100644
--- a/llama-index-integrations/llms/llama-index-llms-ai21/llama_index/llms/ai21/base.py
+++ b/llama-index-integrations/llms/llama-index-llms-ai21/llama_index/llms/ai21/base.py
@@ -12,7 +12,7 @@ from llama_index.core.bridge.pydantic import Field, PrivateAttr
 from llama_index.core.callbacks import CallbackManager
 from llama_index.core.llms.callbacks import llm_chat_callback, llm_completion_callback
 from llama_index.core.llms.custom import CustomLLM
-from llama_index.core.llms.generic_utils import (
+from llama_index.core.base.llms.generic_utils import (
     completion_to_chat_decorator,
     get_from_param_or_env,
 )
diff --git a/llama-index-integrations/llms/llama-index-llms-ai21/tests/test_llms_ai21.py b/llama-index-integrations/llms/llama-index-llms-ai21/tests/test_llms_ai21.py
index fcc355e09e..3f71faba55 100644
--- a/llama-index-integrations/llms/llama-index-llms-ai21/tests/test_llms_ai21.py
+++ b/llama-index-integrations/llms/llama-index-llms-ai21/tests/test_llms_ai21.py
@@ -1,4 +1,4 @@
-from llama_index.core.llms.base import BaseLLM
+from llama_index.core.base.llms.base import BaseLLM
 from llama_index.llms.ai21 import AI21
 
 
diff --git a/llama-index-integrations/llms/llama-index-llms-anthropic/llama_index/llms/anthropic/base.py b/llama-index-integrations/llms/llama-index-llms-anthropic/llama_index/llms/anthropic/base.py
index 9623f5ca07..7fc634cfa0 100644
--- a/llama-index-integrations/llms/llama-index-llms-anthropic/llama_index/llms/anthropic/base.py
+++ b/llama-index-integrations/llms/llama-index-llms-anthropic/llama_index/llms/anthropic/base.py
@@ -18,7 +18,7 @@ from llama_index.core.llms.callbacks import (
     llm_chat_callback,
     llm_completion_callback,
 )
-from llama_index.core.llms.generic_utils import (
+from llama_index.core.base.llms.generic_utils import (
     achat_to_completion_decorator,
     astream_chat_to_completion_decorator,
     chat_to_completion_decorator,
diff --git a/llama-index-integrations/llms/llama-index-llms-anthropic/tests/test_llms_anthropic.py b/llama-index-integrations/llms/llama-index-llms-anthropic/tests/test_llms_anthropic.py
index 991430cb98..e5215cd3cf 100644
--- a/llama-index-integrations/llms/llama-index-llms-anthropic/tests/test_llms_anthropic.py
+++ b/llama-index-integrations/llms/llama-index-llms-anthropic/tests/test_llms_anthropic.py
@@ -1,4 +1,4 @@
-from llama_index.core.llms.base import BaseLLM
+from llama_index.core.base.llms.base import BaseLLM
 from llama_index.llms.anthropic import Anthropic
 
 
diff --git a/llama-index-integrations/llms/llama-index-llms-anyscale/llama_index/llms/anyscale/base.py b/llama-index-integrations/llms/llama-index-llms-anyscale/llama_index/llms/anyscale/base.py
index 5d84ea3e0d..d7f9849495 100644
--- a/llama-index-integrations/llms/llama-index-llms-anyscale/llama_index/llms/anyscale/base.py
+++ b/llama-index-integrations/llms/llama-index-llms-anyscale/llama_index/llms/anyscale/base.py
@@ -3,7 +3,7 @@ from typing import Any, Callable, Dict, Optional, Sequence
 from llama_index.core.base.llms.types import ChatMessage, LLMMetadata
 from llama_index.core.callbacks import CallbackManager
 from llama_index.core.constants import DEFAULT_NUM_OUTPUTS, DEFAULT_TEMPERATURE
-from llama_index.core.llms.generic_utils import get_from_param_or_env
+from llama_index.core.base.llms.generic_utils import get_from_param_or_env
 from llama_index.core.types import BaseOutputParser, PydanticProgramMode
 from llama_index.llms.anyscale.utils import (
     anyscale_modelname_to_contextsize,
diff --git a/llama-index-integrations/llms/llama-index-llms-anyscale/llama_index/llms/anyscale/utils.py b/llama-index-integrations/llms/llama-index-llms-anyscale/llama_index/llms/anyscale/utils.py
index ed5a235dc0..c2fc2925b9 100644
--- a/llama-index-integrations/llms/llama-index-llms-anyscale/llama_index/llms/anyscale/utils.py
+++ b/llama-index-integrations/llms/llama-index-llms-anyscale/llama_index/llms/anyscale/utils.py
@@ -1,7 +1,7 @@
 from typing import Any, Dict, List, Optional, Sequence, Tuple
 
 from llama_index.core.base.llms.types import ChatMessage, MessageRole
-from llama_index.core.llms.generic_utils import get_from_param_or_env
+from llama_index.core.base.llms.generic_utils import get_from_param_or_env
 
 DEFAULT_ANYSCALE_API_BASE = "https://api.endpoints.anyscale.com/v1"
 DEFAULT_ANYSCALE_API_VERSION = ""
diff --git a/llama-index-integrations/llms/llama-index-llms-anyscale/tests/test_llms_anyscale.py b/llama-index-integrations/llms/llama-index-llms-anyscale/tests/test_llms_anyscale.py
index 5c91579cd7..68129f5ab0 100644
--- a/llama-index-integrations/llms/llama-index-llms-anyscale/tests/test_llms_anyscale.py
+++ b/llama-index-integrations/llms/llama-index-llms-anyscale/tests/test_llms_anyscale.py
@@ -1,4 +1,4 @@
-from llama_index.core.llms.base import BaseLLM
+from llama_index.core.base.llms.base import BaseLLM
 from llama_index.llms.anyscale import Anyscale
 
 
diff --git a/llama-index-integrations/llms/llama-index-llms-azure-openai/llama_index/llms/azure_openai/base.py b/llama-index-integrations/llms/llama-index-llms-azure-openai/llama_index/llms/azure_openai/base.py
index b41006eee6..6297019c26 100644
--- a/llama-index-integrations/llms/llama-index-llms-azure-openai/llama_index/llms/azure_openai/base.py
+++ b/llama-index-integrations/llms/llama-index-llms-azure-openai/llama_index/llms/azure_openai/base.py
@@ -4,7 +4,7 @@ import httpx
 from llama_index.core.base.llms.types import ChatMessage
 from llama_index.core.bridge.pydantic import Field, PrivateAttr, root_validator
 from llama_index.core.callbacks import CallbackManager
-from llama_index.core.llms.generic_utils import get_from_param_or_env
+from llama_index.core.base.llms.generic_utils import get_from_param_or_env
 from llama_index.core.types import BaseOutputParser, PydanticProgramMode
 from llama_index.llms.azure_openai.utils import (
     refresh_openai_azuread_token,
diff --git a/llama-index-integrations/llms/llama-index-llms-azure-openai/tests/test_llms_azure_openai.py b/llama-index-integrations/llms/llama-index-llms-azure-openai/tests/test_llms_azure_openai.py
index 6fd623d8d2..1ba4a3c691 100644
--- a/llama-index-integrations/llms/llama-index-llms-azure-openai/tests/test_llms_azure_openai.py
+++ b/llama-index-integrations/llms/llama-index-llms-azure-openai/tests/test_llms_azure_openai.py
@@ -1,4 +1,4 @@
-from llama_index.core.llms.base import BaseLLM
+from llama_index.core.base.llms.base import BaseLLM
 from llama_index.llms.azure_openai import AzureOpenAI
 
 
diff --git a/llama-index-integrations/llms/llama-index-llms-bedrock/llama_index/llms/bedrock/base.py b/llama-index-integrations/llms/llama-index-llms-bedrock/llama_index/llms/bedrock/base.py
index d5ecfe0e51..ae9c1b4b73 100644
--- a/llama-index-integrations/llms/llama-index-llms-bedrock/llama_index/llms/bedrock/base.py
+++ b/llama-index-integrations/llms/llama-index-llms-bedrock/llama_index/llms/bedrock/base.py
@@ -20,7 +20,7 @@ from llama_index.core.llms.callbacks import (
     llm_chat_callback,
     llm_completion_callback,
 )
-from llama_index.core.llms.generic_utils import (
+from llama_index.core.base.llms.generic_utils import (
     completion_response_to_chat_response,
     stream_completion_response_to_chat_response,
 )
diff --git a/llama-index-integrations/llms/llama-index-llms-bedrock/llama_index/llms/bedrock/utils.py b/llama-index-integrations/llms/llama-index-llms-bedrock/llama_index/llms/bedrock/utils.py
index 1eb9b62ee6..df1f3a4848 100644
--- a/llama-index-integrations/llms/llama-index-llms-bedrock/llama_index/llms/bedrock/utils.py
+++ b/llama-index-integrations/llms/llama-index-llms-bedrock/llama_index/llms/bedrock/utils.py
@@ -3,7 +3,7 @@ from abc import ABC, abstractmethod
 from typing import Any, Callable, Optional, Sequence
 
 from llama_index.core.base.llms.types import ChatMessage
-from llama_index.core.llms.generic_utils import (
+from llama_index.core.base.llms.generic_utils import (
     prompt_to_messages,
 )
 from llama_index.llms.anthropic.utils import messages_to_anthropic_prompt
diff --git a/llama-index-integrations/llms/llama-index-llms-bedrock/tests/test_llms_bedrock.py b/llama-index-integrations/llms/llama-index-llms-bedrock/tests/test_llms_bedrock.py
index e65f8a18ba..af0c4aa142 100644
--- a/llama-index-integrations/llms/llama-index-llms-bedrock/tests/test_llms_bedrock.py
+++ b/llama-index-integrations/llms/llama-index-llms-bedrock/tests/test_llms_bedrock.py
@@ -1,4 +1,4 @@
-from llama_index.core.llms.base import BaseLLM
+from llama_index.core.base.llms.base import BaseLLM
 from llama_index.llms.bedrock import Bedrock
 
 
diff --git a/llama-index-integrations/llms/llama-index-llms-cohere/tests/test_llms_cohere.py b/llama-index-integrations/llms/llama-index-llms-cohere/tests/test_llms_cohere.py
index 11a37d801a..f18b9558c3 100644
--- a/llama-index-integrations/llms/llama-index-llms-cohere/tests/test_llms_cohere.py
+++ b/llama-index-integrations/llms/llama-index-llms-cohere/tests/test_llms_cohere.py
@@ -1,4 +1,4 @@
-from llama_index.core.llms.base import BaseLLM
+from llama_index.core.base.llms.base import BaseLLM
 from llama_index.llms.cohere import Cohere
 
 
diff --git a/llama-index-integrations/llms/llama-index-llms-dashscope/tests/test_llms_dashscope.py b/llama-index-integrations/llms/llama-index-llms-dashscope/tests/test_llms_dashscope.py
index 885e6e25b5..375e24fbfc 100644
--- a/llama-index-integrations/llms/llama-index-llms-dashscope/tests/test_llms_dashscope.py
+++ b/llama-index-integrations/llms/llama-index-llms-dashscope/tests/test_llms_dashscope.py
@@ -1,4 +1,4 @@
-from llama_index.core.llms.base import BaseLLM
+from llama_index.core.base.llms.base import BaseLLM
 from llama_index.llms.dashscope import DashScope
 
 
diff --git a/llama-index-integrations/llms/llama-index-llms-everlyai/llama_index/llms/everlyai/base.py b/llama-index-integrations/llms/llama-index-llms-everlyai/llama_index/llms/everlyai/base.py
index c8a7afcab7..fb0d81bdb1 100644
--- a/llama-index-integrations/llms/llama-index-llms-everlyai/llama_index/llms/everlyai/base.py
+++ b/llama-index-integrations/llms/llama-index-llms-everlyai/llama_index/llms/everlyai/base.py
@@ -3,7 +3,7 @@ from typing import Any, Callable, Dict, Optional, Sequence
 from llama_index.core.base.llms.types import ChatMessage, LLMMetadata
 from llama_index.core.callbacks import CallbackManager
 from llama_index.core.constants import DEFAULT_NUM_OUTPUTS, DEFAULT_TEMPERATURE
-from llama_index.core.llms.generic_utils import get_from_param_or_env
+from llama_index.core.base.llms.generic_utils import get_from_param_or_env
 from llama_index.core.types import BaseOutputParser, PydanticProgramMode
 from llama_index.llms.everlyai.utils import everlyai_modelname_to_contextsize
 from llama_index.llms.openai import OpenAI
diff --git a/llama-index-integrations/llms/llama-index-llms-everlyai/tests/test_llms_everlyai.py b/llama-index-integrations/llms/llama-index-llms-everlyai/tests/test_llms_everlyai.py
index 4eddba63e1..970d2b0326 100644
--- a/llama-index-integrations/llms/llama-index-llms-everlyai/tests/test_llms_everlyai.py
+++ b/llama-index-integrations/llms/llama-index-llms-everlyai/tests/test_llms_everlyai.py
@@ -1,4 +1,4 @@
-from llama_index.core.llms.base import BaseLLM
+from llama_index.core.base.llms.base import BaseLLM
 from llama_index.llms.everlyai import EverlyAI
 
 
diff --git a/llama-index-integrations/llms/llama-index-llms-gemini/llama_index/llms/gemini/utils.py b/llama-index-integrations/llms/llama-index-llms-gemini/llama_index/llms/gemini/utils.py
index dd65f4784c..8bc01a53c0 100644
--- a/llama-index-integrations/llms/llama-index-llms-gemini/llama_index/llms/gemini/utils.py
+++ b/llama-index-integrations/llms/llama-index-llms-gemini/llama_index/llms/gemini/utils.py
@@ -4,7 +4,7 @@ import google.ai.generativelanguage as glm
 import google.generativeai as genai
 import PIL
 from llama_index.core.base.llms.types import MessageRole
-from llama_index.core.llms.base import (
+from llama_index.core.base.llms.types import (
     ChatMessage,
     ChatResponse,
     CompletionResponse,
diff --git a/llama-index-integrations/llms/llama-index-llms-gemini/tests/test_llms_gemini.py b/llama-index-integrations/llms/llama-index-llms-gemini/tests/test_llms_gemini.py
index b9b238d1e3..3e458877ad 100644
--- a/llama-index-integrations/llms/llama-index-llms-gemini/tests/test_llms_gemini.py
+++ b/llama-index-integrations/llms/llama-index-llms-gemini/tests/test_llms_gemini.py
@@ -1,4 +1,4 @@
-from llama_index.core.llms.base import BaseLLM
+from llama_index.core.base.llms.base import BaseLLM
 from llama_index.llms.gemini import Gemini
 
 
diff --git a/llama-index-integrations/llms/llama-index-llms-gradient/tests/test_llms_gradient.py b/llama-index-integrations/llms/llama-index-llms-gradient/tests/test_llms_gradient.py
index 0c8ab23af6..a04347ccbf 100644
--- a/llama-index-integrations/llms/llama-index-llms-gradient/tests/test_llms_gradient.py
+++ b/llama-index-integrations/llms/llama-index-llms-gradient/tests/test_llms_gradient.py
@@ -1,4 +1,4 @@
-from llama_index.core.llms.base import BaseLLM
+from llama_index.core.base.llms.base import BaseLLM
 from llama_index.llms.gradient import GradientBaseModelLLM, GradientModelAdapterLLM
 
 
diff --git a/llama-index-integrations/llms/llama-index-llms-huggingface/llama_index/llms/huggingface/base.py b/llama-index-integrations/llms/llama-index-llms-huggingface/llama_index/llms/huggingface/base.py
index 0d7e6e9120..0d1407e923 100644
--- a/llama-index-integrations/llms/llama-index-llms-huggingface/llama_index/llms/huggingface/base.py
+++ b/llama-index-integrations/llms/llama-index-llms-huggingface/llama_index/llms/huggingface/base.py
@@ -28,11 +28,11 @@ from llama_index.core.llms.callbacks import (
     llm_completion_callback,
 )
 from llama_index.core.llms.custom import CustomLLM
-from llama_index.core.llms.generic_utils import (
+from llama_index.core.base.llms.generic_utils import (
     completion_response_to_chat_response,
     stream_completion_response_to_chat_response,
 )
-from llama_index.core.llms.generic_utils import (
+from llama_index.core.base.llms.generic_utils import (
     messages_to_prompt as generic_messages_to_prompt,
 )
 from llama_index.core.prompts.base import PromptTemplate
diff --git a/llama-index-integrations/llms/llama-index-llms-huggingface/tests/test_llms_huggingface.py b/llama-index-integrations/llms/llama-index-llms-huggingface/tests/test_llms_huggingface.py
index c065b856d2..c65dc8fd0f 100644
--- a/llama-index-integrations/llms/llama-index-llms-huggingface/tests/test_llms_huggingface.py
+++ b/llama-index-integrations/llms/llama-index-llms-huggingface/tests/test_llms_huggingface.py
@@ -1,4 +1,4 @@
-from llama_index.core.llms.base import BaseLLM
+from llama_index.core.base.llms.base import BaseLLM
 from llama_index.llms.huggingface import HuggingFaceInferenceAPI, HuggingFaceLLM
 
 
diff --git a/llama-index-integrations/llms/llama-index-llms-konko/llama_index/llms/konko/base.py b/llama-index-integrations/llms/llama-index-llms-konko/llama_index/llms/konko/base.py
index 036709c642..49fdd7f0fc 100644
--- a/llama-index-integrations/llms/llama-index-llms-konko/llama_index/llms/konko/base.py
+++ b/llama-index-integrations/llms/llama-index-llms-konko/llama_index/llms/konko/base.py
@@ -15,7 +15,7 @@ from llama_index.core.bridge.pydantic import Field
 from llama_index.core.callbacks import CallbackManager
 from llama_index.core.constants import DEFAULT_NUM_OUTPUTS, DEFAULT_TEMPERATURE
 from llama_index.core.llms.callbacks import llm_chat_callback, llm_completion_callback
-from llama_index.core.llms.generic_utils import (
+from llama_index.core.base.llms.generic_utils import (
     achat_to_completion_decorator,
     acompletion_to_chat_decorator,
     astream_chat_to_completion_decorator,
diff --git a/llama-index-integrations/llms/llama-index-llms-konko/llama_index/llms/konko/utils.py b/llama-index-integrations/llms/llama-index-llms-konko/llama_index/llms/konko/utils.py
index bba9fc5ec6..5d310e27e5 100644
--- a/llama-index-integrations/llms/llama-index-llms-konko/llama_index/llms/konko/utils.py
+++ b/llama-index-integrations/llms/llama-index-llms-konko/llama_index/llms/konko/utils.py
@@ -5,7 +5,7 @@ from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Type
 import openai
 from llama_index.core.base.llms.types import ChatMessage
 from llama_index.core.bridge.pydantic import BaseModel
-from llama_index.core.llms.generic_utils import get_from_param_or_env
+from llama_index.core.base.llms.generic_utils import get_from_param_or_env
 from packaging.version import parse
 from tenacity import (
     before_sleep_log,
diff --git a/llama-index-integrations/llms/llama-index-llms-konko/tests/test_llms_konko.py b/llama-index-integrations/llms/llama-index-llms-konko/tests/test_llms_konko.py
index d4a7b1dcba..39aeddc95c 100644
--- a/llama-index-integrations/llms/llama-index-llms-konko/tests/test_llms_konko.py
+++ b/llama-index-integrations/llms/llama-index-llms-konko/tests/test_llms_konko.py
@@ -1,4 +1,4 @@
-from llama_index.core.llms.base import BaseLLM
+from llama_index.core.base.llms.base import BaseLLM
 from llama_index.llms.konko import Konko
 
 
diff --git a/llama-index-integrations/llms/llama-index-llms-langchain/llama_index/llms/langchain/base.py b/llama-index-integrations/llms/llama-index-llms-langchain/llama_index/llms/langchain/base.py
index 01fb8b2723..4e463cf7f5 100644
--- a/llama-index-integrations/llms/llama-index-llms-langchain/llama_index/llms/langchain/base.py
+++ b/llama-index-integrations/llms/llama-index-llms-langchain/llama_index/llms/langchain/base.py
@@ -14,7 +14,7 @@ from llama_index.core.base.llms.types import (
 from llama_index.core.bridge.pydantic import PrivateAttr
 from llama_index.core.callbacks import CallbackManager
 from llama_index.core.llms.callbacks import llm_chat_callback, llm_completion_callback
-from llama_index.core.llms.generic_utils import (
+from llama_index.core.base.llms.generic_utils import (
     completion_response_to_chat_response,
     stream_completion_response_to_chat_response,
 )
diff --git a/llama-index-integrations/llms/llama-index-llms-langchain/tests/test_llms_langchain.py b/llama-index-integrations/llms/llama-index-llms-langchain/tests/test_llms_langchain.py
index 9a101969c0..4d01c5f1ec 100644
--- a/llama-index-integrations/llms/llama-index-llms-langchain/tests/test_llms_langchain.py
+++ b/llama-index-integrations/llms/llama-index-llms-langchain/tests/test_llms_langchain.py
@@ -1,4 +1,4 @@
-from llama_index.core.llms.base import BaseLLM
+from llama_index.core.base.llms.base import BaseLLM
 from llama_index.llms.langchain import LangChainLLM
 
 
diff --git a/llama-index-integrations/llms/llama-index-llms-litellm/llama_index/llms/litellm/base.py b/llama-index-integrations/llms/llama-index-llms-litellm/llama_index/llms/litellm/base.py
index 17c2a415de..52e6fe74a4 100644
--- a/llama-index-integrations/llms/llama-index-llms-litellm/llama_index/llms/litellm/base.py
+++ b/llama-index-integrations/llms/llama-index-llms-litellm/llama_index/llms/litellm/base.py
@@ -14,7 +14,7 @@ from llama_index.core.bridge.pydantic import Field
 from llama_index.core.callbacks import CallbackManager
 from llama_index.core.constants import DEFAULT_TEMPERATURE
 from llama_index.core.llms.callbacks import llm_chat_callback, llm_completion_callback
-from llama_index.core.llms.generic_utils import (
+from llama_index.core.base.llms.generic_utils import (
     achat_to_completion_decorator,
     acompletion_to_chat_decorator,
     astream_chat_to_completion_decorator,
diff --git a/llama-index-integrations/llms/llama-index-llms-litellm/tests/test_llms_litellm.py b/llama-index-integrations/llms/llama-index-llms-litellm/tests/test_llms_litellm.py
index 8c295f53bb..fd55aa0a33 100644
--- a/llama-index-integrations/llms/llama-index-llms-litellm/tests/test_llms_litellm.py
+++ b/llama-index-integrations/llms/llama-index-llms-litellm/tests/test_llms_litellm.py
@@ -1,4 +1,4 @@
-from llama_index.core.llms.base import BaseLLM
+from llama_index.core.base.llms.base import BaseLLM
 from llama_index.llms.litellm import LiteLLM
 
 
diff --git a/llama-index-integrations/llms/llama-index-llms-llama-api/llama_index/llms/llama_api/base.py b/llama-index-integrations/llms/llama-index-llms-llama-api/llama_index/llms/llama_api/base.py
index 657bac868d..84f6f79f40 100644
--- a/llama-index-integrations/llms/llama-index-llms-llama-api/llama_index/llms/llama_api/base.py
+++ b/llama-index-integrations/llms/llama-index-llms-llama-api/llama_index/llms/llama_api/base.py
@@ -13,7 +13,7 @@ from llama_index.core.callbacks import CallbackManager
 from llama_index.core.constants import DEFAULT_NUM_OUTPUTS
 from llama_index.core.llms.callbacks import llm_chat_callback, llm_completion_callback
 from llama_index.core.llms.custom import CustomLLM
-from llama_index.core.llms.generic_utils import chat_to_completion_decorator
+from llama_index.core.base.llms.generic_utils import chat_to_completion_decorator
 from llama_index.core.types import BaseOutputParser, PydanticProgramMode
 from llama_index.llms.openai.utils import (
     from_openai_message_dict,
diff --git a/llama-index-integrations/llms/llama-index-llms-llama-api/tests/test_llms_llama_api.py b/llama-index-integrations/llms/llama-index-llms-llama-api/tests/test_llms_llama_api.py
index b9593bac9e..feecc7c066 100644
--- a/llama-index-integrations/llms/llama-index-llms-llama-api/tests/test_llms_llama_api.py
+++ b/llama-index-integrations/llms/llama-index-llms-llama-api/tests/test_llms_llama_api.py
@@ -1,4 +1,4 @@
-from llama_index.core.llms.base import BaseLLM
+from llama_index.core.base.llms.base import BaseLLM
 from llama_index.llms.llama_api import LlamaAPI
 
 
diff --git a/llama-index-integrations/llms/llama-index-llms-llama-cpp/llama_index/llms/llama_cpp/base.py b/llama-index-integrations/llms/llama-index-llms-llama-cpp/llama_index/llms/llama_cpp/base.py
index f8c1f65dbb..809b19276d 100644
--- a/llama-index-integrations/llms/llama-index-llms-llama-cpp/llama_index/llms/llama_cpp/base.py
+++ b/llama-index-integrations/llms/llama-index-llms-llama-cpp/llama_index/llms/llama_cpp/base.py
@@ -19,7 +19,7 @@ from llama_index.core.constants import (
 )
 from llama_index.core.llms.callbacks import llm_chat_callback, llm_completion_callback
 from llama_index.core.llms.custom import CustomLLM
-from llama_index.core.llms.generic_utils import (
+from llama_index.core.base.llms.generic_utils import (
     completion_response_to_chat_response,
     stream_completion_response_to_chat_response,
 )
diff --git a/llama-index-integrations/llms/llama-index-llms-llama-cpp/tests/test_llms_llama_cpp.py b/llama-index-integrations/llms/llama-index-llms-llama-cpp/tests/test_llms_llama_cpp.py
index deb9d0d48d..d72ca52429 100644
--- a/llama-index-integrations/llms/llama-index-llms-llama-cpp/tests/test_llms_llama_cpp.py
+++ b/llama-index-integrations/llms/llama-index-llms-llama-cpp/tests/test_llms_llama_cpp.py
@@ -1,4 +1,4 @@
-from llama_index.core.llms.base import BaseLLM
+from llama_index.core.base.llms.base import BaseLLM
 from llama_index.llms.llama_cpp import LlamaCPP
 
 
diff --git a/llama-index-integrations/llms/llama-index-llms-localai/tests/test_llms_localai.py b/llama-index-integrations/llms/llama-index-llms-localai/tests/test_llms_localai.py
index a1ef189486..2ebb0203b5 100644
--- a/llama-index-integrations/llms/llama-index-llms-localai/tests/test_llms_localai.py
+++ b/llama-index-integrations/llms/llama-index-llms-localai/tests/test_llms_localai.py
@@ -1,4 +1,4 @@
-from llama_index.core.llms.base import BaseLLM
+from llama_index.core.base.llms.base import BaseLLM
 from llama_index.llms.localai import LocalAI
 
 
diff --git a/llama-index-integrations/llms/llama-index-llms-mistralai/llama_index/llms/mistralai/base.py b/llama-index-integrations/llms/llama-index-llms-mistralai/llama_index/llms/mistralai/base.py
index 9eb7640e24..05977726e8 100644
--- a/llama-index-integrations/llms/llama-index-llms-mistralai/llama_index/llms/mistralai/base.py
+++ b/llama-index-integrations/llms/llama-index-llms-mistralai/llama_index/llms/mistralai/base.py
@@ -19,7 +19,7 @@ from llama_index.core.llms.callbacks import (
     llm_chat_callback,
     llm_completion_callback,
 )
-from llama_index.core.llms.generic_utils import (
+from llama_index.core.base.llms.generic_utils import (
     achat_to_completion_decorator,
     astream_chat_to_completion_decorator,
     chat_to_completion_decorator,
diff --git a/llama-index-integrations/llms/llama-index-llms-mistralai/tests/test_llms_mistral.py b/llama-index-integrations/llms/llama-index-llms-mistralai/tests/test_llms_mistral.py
index 5df2423c19..c89091e66b 100644
--- a/llama-index-integrations/llms/llama-index-llms-mistralai/tests/test_llms_mistral.py
+++ b/llama-index-integrations/llms/llama-index-llms-mistralai/tests/test_llms_mistral.py
@@ -1,4 +1,4 @@
-from llama_index.core.llms.base import BaseLLM
+from llama_index.core.base.llms.base import BaseLLM
 from llama_index.llms.mistralai import MistralAI
 
 
diff --git a/llama-index-integrations/llms/llama-index-llms-monsterapi/tests/test_llms_monsterapi.py b/llama-index-integrations/llms/llama-index-llms-monsterapi/tests/test_llms_monsterapi.py
index f5fb195247..f8d4434d4b 100644
--- a/llama-index-integrations/llms/llama-index-llms-monsterapi/tests/test_llms_monsterapi.py
+++ b/llama-index-integrations/llms/llama-index-llms-monsterapi/tests/test_llms_monsterapi.py
@@ -1,4 +1,4 @@
-from llama_index.core.llms.base import BaseLLM
+from llama_index.core.base.llms.base import BaseLLM
 from llama_index.llms.monsterapi import MonsterLLM
 
 
diff --git a/llama-index-integrations/llms/llama-index-llms-neutrino/llama_index/llms/neutrino/base.py b/llama-index-integrations/llms/llama-index-llms-neutrino/llama_index/llms/neutrino/base.py
index 8b0abea1aa..b1470353b6 100644
--- a/llama-index-integrations/llms/llama-index-llms-neutrino/llama_index/llms/neutrino/base.py
+++ b/llama-index-integrations/llms/llama-index-llms-neutrino/llama_index/llms/neutrino/base.py
@@ -6,7 +6,7 @@ from llama_index.core.constants import (
     DEFAULT_NUM_OUTPUTS,
     DEFAULT_TEMPERATURE,
 )
-from llama_index.core.llms.generic_utils import get_from_param_or_env
+from llama_index.core.base.llms.generic_utils import get_from_param_or_env
 from llama_index.llms.openai_like import OpenAILike
 
 DEFAULT_API_BASE = "https://router.neutrinoapp.com/api/llm-router"
diff --git a/llama-index-integrations/llms/llama-index-llms-neutrino/tests/test_llms_neutrino.py b/llama-index-integrations/llms/llama-index-llms-neutrino/tests/test_llms_neutrino.py
index 5b1583f0be..cff486909c 100644
--- a/llama-index-integrations/llms/llama-index-llms-neutrino/tests/test_llms_neutrino.py
+++ b/llama-index-integrations/llms/llama-index-llms-neutrino/tests/test_llms_neutrino.py
@@ -1,4 +1,4 @@
-from llama_index.core.llms.base import BaseLLM
+from llama_index.core.base.llms.base import BaseLLM
 from llama_index.llms.neutrino import Neutrino
 
 
diff --git a/llama-index-integrations/llms/llama-index-llms-nvidia-tensorrt/llama_index/llms/nvidia_tensorrt/base.py b/llama-index-integrations/llms/llama-index-llms-nvidia-tensorrt/llama_index/llms/nvidia_tensorrt/base.py
index dc707bae31..7114c4c04e 100644
--- a/llama-index-integrations/llms/llama-index-llms-nvidia-tensorrt/llama_index/llms/nvidia_tensorrt/base.py
+++ b/llama-index-integrations/llms/llama-index-llms-nvidia-tensorrt/llama_index/llms/nvidia_tensorrt/base.py
@@ -9,7 +9,7 @@ import torch
 from llama_index.core.bridge.pydantic import Field, PrivateAttr
 from llama_index.core.callbacks import CallbackManager
 from llama_index.core.constants import DEFAULT_CONTEXT_WINDOW, DEFAULT_NUM_OUTPUTS
-from llama_index.core.llms.base import (
+from llama_index.core.base.llms.types import (
     ChatMessage,
     ChatResponse,
     CompletionResponse,
@@ -20,7 +20,9 @@ from llama_index.core.llms.callbacks import (
     llm_completion_callback,
 )
 from llama_index.core.llms.custom import CustomLLM
-from llama_index.core.llms.generic_utils import completion_response_to_chat_response
+from llama_index.core.base.llms.generic_utils import (
+    completion_response_to_chat_response,
+)
 from llama_index.llms.nvidia_tensorrt.utils import (
     generate_completion_dict,
     get_output,
diff --git a/llama-index-integrations/llms/llama-index-llms-nvidia-tensorrt/tests/test_llms_nvidia_tensorrt.py b/llama-index-integrations/llms/llama-index-llms-nvidia-tensorrt/tests/test_llms_nvidia_tensorrt.py
index 458b505f76..224e9a38f5 100644
--- a/llama-index-integrations/llms/llama-index-llms-nvidia-tensorrt/tests/test_llms_nvidia_tensorrt.py
+++ b/llama-index-integrations/llms/llama-index-llms-nvidia-tensorrt/tests/test_llms_nvidia_tensorrt.py
@@ -1,4 +1,4 @@
-from llama_index.core.llms.base import BaseLLM
+from llama_index.core.base.llms.base import BaseLLM
 from llama_index.llms.nvidia_tensorrt import LocalTensorRTLLM
 
 
diff --git a/llama-index-integrations/llms/llama-index-llms-nvidia-triton/llama_index/llms/nvidia_triton/base.py b/llama-index-integrations/llms/llama-index-llms-nvidia-triton/llama_index/llms/nvidia_triton/base.py
index c9af03ae2f..430a4eab21 100644
--- a/llama-index-integrations/llms/llama-index-llms-nvidia-triton/llama_index/llms/nvidia_triton/base.py
+++ b/llama-index-integrations/llms/llama-index-llms-nvidia-triton/llama_index/llms/nvidia_triton/base.py
@@ -8,7 +8,7 @@ from typing import (
 
 from llama_index.core.bridge.pydantic import Field, PrivateAttr
 from llama_index.core.callbacks import CallbackManager
-from llama_index.core.llms.base import (
+from llama_index.core.base.llms.types import (
     ChatMessage,
     ChatResponse,
     ChatResponseAsyncGen,
@@ -19,7 +19,7 @@ from llama_index.core.llms.base import (
     LLMMetadata,
 )
 from llama_index.core.llms.callbacks import llm_chat_callback
-from llama_index.core.llms.generic_utils import (
+from llama_index.core.base.llms.generic_utils import (
     completion_to_chat_decorator,
 )
 from llama_index.core.llms.llm import LLM
diff --git a/llama-index-integrations/llms/llama-index-llms-nvidia-triton/tests/test_llms_nvidia_triton.py b/llama-index-integrations/llms/llama-index-llms-nvidia-triton/tests/test_llms_nvidia_triton.py
index 26239092cb..c0058b15a1 100644
--- a/llama-index-integrations/llms/llama-index-llms-nvidia-triton/tests/test_llms_nvidia_triton.py
+++ b/llama-index-integrations/llms/llama-index-llms-nvidia-triton/tests/test_llms_nvidia_triton.py
@@ -1,4 +1,4 @@
-from llama_index.core.llms.base import BaseLLM
+from llama_index.core.base.llms.base import BaseLLM
 from llama_index.llms.nvidia_triton import NvidiaTriton
 
 
diff --git a/llama-index-integrations/llms/llama-index-llms-ollama/tests/test_llms_ollama.py b/llama-index-integrations/llms/llama-index-llms-ollama/tests/test_llms_ollama.py
index 2a73532a45..695a83a08a 100644
--- a/llama-index-integrations/llms/llama-index-llms-ollama/tests/test_llms_ollama.py
+++ b/llama-index-integrations/llms/llama-index-llms-ollama/tests/test_llms_ollama.py
@@ -1,4 +1,4 @@
-from llama_index.core.llms.base import BaseLLM
+from llama_index.core.base.llms.base import BaseLLM
 from llama_index.llms.ollama import Ollama
 
 
diff --git a/llama-index-integrations/llms/llama-index-llms-openai-like/llama_index/llms/openai_like/base.py b/llama-index-integrations/llms/llama-index-llms-openai-like/llama_index/llms/openai_like/base.py
index 424e57babc..f5184a8753 100644
--- a/llama-index-integrations/llms/llama-index-llms-openai-like/llama_index/llms/openai_like/base.py
+++ b/llama-index-integrations/llms/llama-index-llms-openai-like/llama_index/llms/openai_like/base.py
@@ -12,7 +12,7 @@ from llama_index.core.base.llms.types import (
 )
 from llama_index.core.bridge.pydantic import Field
 from llama_index.core.constants import DEFAULT_CONTEXT_WINDOW
-from llama_index.core.llms.generic_utils import (
+from llama_index.core.base.llms.generic_utils import (
     async_stream_completion_response_to_chat_response,
     completion_response_to_chat_response,
     stream_completion_response_to_chat_response,
diff --git a/llama-index-integrations/llms/llama-index-llms-openai-like/tests/test_llms_openai_like.py b/llama-index-integrations/llms/llama-index-llms-openai-like/tests/test_llms_openai_like.py
index 50e86b53d2..d87a63b738 100644
--- a/llama-index-integrations/llms/llama-index-llms-openai-like/tests/test_llms_openai_like.py
+++ b/llama-index-integrations/llms/llama-index-llms-openai-like/tests/test_llms_openai_like.py
@@ -1,4 +1,4 @@
-from llama_index.core.llms.base import BaseLLM
+from llama_index.core.base.llms.base import BaseLLM
 from llama_index.llms.openai_like import OpenAILike
 
 
diff --git a/llama-index-integrations/llms/llama-index-llms-openai/llama_index/llms/openai/base.py b/llama-index-integrations/llms/llama-index-llms-openai/llama_index/llms/openai/base.py
index 1a8da01a33..379a0f65ac 100644
--- a/llama-index-integrations/llms/llama-index-llms-openai/llama_index/llms/openai/base.py
+++ b/llama-index-integrations/llms/llama-index-llms-openai/llama_index/llms/openai/base.py
@@ -33,7 +33,7 @@ from llama_index.core.llms.callbacks import (
     llm_chat_callback,
     llm_completion_callback,
 )
-from llama_index.core.llms.generic_utils import (
+from llama_index.core.base.llms.generic_utils import (
     achat_to_completion_decorator,
     acompletion_to_chat_decorator,
     astream_chat_to_completion_decorator,
diff --git a/llama-index-integrations/llms/llama-index-llms-openai/llama_index/llms/openai/utils.py b/llama-index-integrations/llms/llama-index-llms-openai/llama_index/llms/openai/utils.py
index 23fb6c14ed..d3cd4cdc0a 100644
--- a/llama-index-integrations/llms/llama-index-llms-openai/llama_index/llms/openai/utils.py
+++ b/llama-index-integrations/llms/llama-index-llms-openai/llama_index/llms/openai/utils.py
@@ -5,7 +5,7 @@ from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Type, U
 from deprecated import deprecated
 from llama_index.core.base.llms.types import ChatMessage
 from llama_index.core.bridge.pydantic import BaseModel
-from llama_index.core.llms.generic_utils import get_from_param_or_env
+from llama_index.core.base.llms.generic_utils import get_from_param_or_env
 from tenacity import (
     before_sleep_log,
     retry,
diff --git a/llama-index-integrations/llms/llama-index-llms-openai/tests/test_llms_openai.py b/llama-index-integrations/llms/llama-index-llms-openai/tests/test_llms_openai.py
index 2c8eb24ffd..096898b908 100644
--- a/llama-index-integrations/llms/llama-index-llms-openai/tests/test_llms_openai.py
+++ b/llama-index-integrations/llms/llama-index-llms-openai/tests/test_llms_openai.py
@@ -1,4 +1,4 @@
-from llama_index.core.llms.base import BaseLLM
+from llama_index.core.base.llms.base import BaseLLM
 from llama_index.llms.openai import OpenAI
 
 
diff --git a/llama-index-integrations/llms/llama-index-llms-openllm/llama_index/llms/openllm/base.py b/llama-index-integrations/llms/llama-index-llms-openllm/llama_index/llms/openllm/base.py
index a1b2dc49ee..b0e5039037 100644
--- a/llama-index-integrations/llms/llama-index-llms-openllm/llama_index/llms/openllm/base.py
+++ b/llama-index-integrations/llms/llama-index-llms-openllm/llama_index/llms/openllm/base.py
@@ -27,10 +27,10 @@ from llama_index.core.llms.callbacks import (
     llm_chat_callback,
     llm_completion_callback,
 )
-from llama_index.core.llms.generic_utils import (
+from llama_index.core.base.llms.generic_utils import (
     completion_response_to_chat_response,
 )
-from llama_index.core.llms.generic_utils import (
+from llama_index.core.base.llms.generic_utils import (
     messages_to_prompt as generic_messages_to_prompt,
 )
 from llama_index.core.llms.llm import LLM
diff --git a/llama-index-integrations/llms/llama-index-llms-openrouter/llama_index/llms/openrouter/base.py b/llama-index-integrations/llms/llama-index-llms-openrouter/llama_index/llms/openrouter/base.py
index 3743f2691d..0b1e928294 100644
--- a/llama-index-integrations/llms/llama-index-llms-openrouter/llama_index/llms/openrouter/base.py
+++ b/llama-index-integrations/llms/llama-index-llms-openrouter/llama_index/llms/openrouter/base.py
@@ -7,7 +7,7 @@ from llama_index.core.constants import (
     DEFAULT_NUM_OUTPUTS,
     DEFAULT_TEMPERATURE,
 )
-from llama_index.core.llms.generic_utils import get_from_param_or_env
+from llama_index.core.base.llms.generic_utils import get_from_param_or_env
 from llama_index.llms.openai_like import OpenAILike
 
 DEFAULT_API_BASE = "https://openrouter.ai/api/v1"
diff --git a/llama-index-integrations/llms/llama-index-llms-openrouter/tests/test_llms_openrouter.py b/llama-index-integrations/llms/llama-index-llms-openrouter/tests/test_llms_openrouter.py
index 29cf183dd7..ad037c1749 100644
--- a/llama-index-integrations/llms/llama-index-llms-openrouter/tests/test_llms_openrouter.py
+++ b/llama-index-integrations/llms/llama-index-llms-openrouter/tests/test_llms_openrouter.py
@@ -1,4 +1,4 @@
-from llama_index.core.llms.base import BaseLLM
+from llama_index.core.base.llms.base import BaseLLM
 from llama_index.llms.openrouter import OpenRouter
 
 
diff --git a/llama-index-integrations/llms/llama-index-llms-palm/tests/test_llms_palm.py b/llama-index-integrations/llms/llama-index-llms-palm/tests/test_llms_palm.py
index 019689d3c5..686da75b3f 100644
--- a/llama-index-integrations/llms/llama-index-llms-palm/tests/test_llms_palm.py
+++ b/llama-index-integrations/llms/llama-index-llms-palm/tests/test_llms_palm.py
@@ -1,4 +1,4 @@
-from llama_index.core.llms.base import BaseLLM
+from llama_index.core.base.llms.base import BaseLLM
 from llama_index.llms.palm import PaLM
 
 
diff --git a/llama-index-integrations/llms/llama-index-llms-perplexity/tests/test_llms_perplexity.py b/llama-index-integrations/llms/llama-index-llms-perplexity/tests/test_llms_perplexity.py
index 9c3c5e5161..85981c61fd 100644
--- a/llama-index-integrations/llms/llama-index-llms-perplexity/tests/test_llms_perplexity.py
+++ b/llama-index-integrations/llms/llama-index-llms-perplexity/tests/test_llms_perplexity.py
@@ -1,4 +1,4 @@
-from llama_index.core.llms.base import BaseLLM
+from llama_index.core.base.llms.base import BaseLLM
 from llama_index.llms.perplexity import Perplexity
 
 
diff --git a/llama-index-integrations/llms/llama-index-llms-portkey/llama_index/llms/portkey/base.py b/llama-index-integrations/llms/llama-index-llms-portkey/llama_index/llms/portkey/base.py
index 0bafff1e2b..30cb1e744c 100644
--- a/llama-index-integrations/llms/llama-index-llms-portkey/llama_index/llms/portkey/base.py
+++ b/llama-index-integrations/llms/llama-index-llms-portkey/llama_index/llms/portkey/base.py
@@ -1,6 +1,7 @@
 """
 Portkey integration with Llama_index for enhanced monitoring.
 """
+
 from typing import TYPE_CHECKING, Any, Callable, List, Optional, Sequence, Union, cast
 
 from llama_index.core.base.llms.types import (
@@ -14,7 +15,7 @@ from llama_index.core.base.llms.types import (
 from llama_index.core.bridge.pydantic import Field, PrivateAttr
 from llama_index.core.llms.callbacks import llm_chat_callback, llm_completion_callback
 from llama_index.core.llms.custom import CustomLLM
-from llama_index.core.llms.generic_utils import (
+from llama_index.core.base.llms.generic_utils import (
     chat_to_completion_decorator,
     completion_to_chat_decorator,
     stream_chat_to_completion_decorator,
diff --git a/llama-index-integrations/llms/llama-index-llms-portkey/tests/test_llms_portkey.py b/llama-index-integrations/llms/llama-index-llms-portkey/tests/test_llms_portkey.py
index 305c8e7947..035cea31b7 100644
--- a/llama-index-integrations/llms/llama-index-llms-portkey/tests/test_llms_portkey.py
+++ b/llama-index-integrations/llms/llama-index-llms-portkey/tests/test_llms_portkey.py
@@ -1,4 +1,4 @@
-from llama_index.core.llms.base import BaseLLM
+from llama_index.core.base.llms.base import BaseLLM
 from llama_index.llms.portkey import Portkey
 
 
diff --git a/llama-index-integrations/llms/llama-index-llms-predibase/tests/test_llms_predibase.py b/llama-index-integrations/llms/llama-index-llms-predibase/tests/test_llms_predibase.py
index 6adbd916c3..234c824829 100644
--- a/llama-index-integrations/llms/llama-index-llms-predibase/tests/test_llms_predibase.py
+++ b/llama-index-integrations/llms/llama-index-llms-predibase/tests/test_llms_predibase.py
@@ -1,4 +1,4 @@
-from llama_index.core.llms.base import BaseLLM
+from llama_index.core.base.llms.base import BaseLLM
 from llama_index.llms.predibase import PredibaseLLM
 
 
diff --git a/llama-index-integrations/llms/llama-index-llms-replicate/llama_index/llms/replicate/base.py b/llama-index-integrations/llms/llama-index-llms-replicate/llama_index/llms/replicate/base.py
index f56e819087..297715ba56 100644
--- a/llama-index-integrations/llms/llama-index-llms-replicate/llama_index/llms/replicate/base.py
+++ b/llama-index-integrations/llms/llama-index-llms-replicate/llama_index/llms/replicate/base.py
@@ -12,7 +12,7 @@ from llama_index.core.bridge.pydantic import Field
 from llama_index.core.constants import DEFAULT_CONTEXT_WINDOW, DEFAULT_NUM_OUTPUTS
 from llama_index.core.llms.callbacks import llm_chat_callback, llm_completion_callback
 from llama_index.core.llms.custom import CustomLLM
-from llama_index.core.llms.generic_utils import (
+from llama_index.core.base.llms.generic_utils import (
     completion_response_to_chat_response,
     stream_completion_response_to_chat_response,
 )
diff --git a/llama-index-integrations/llms/llama-index-llms-replicate/tests/test_llms_replicate.py b/llama-index-integrations/llms/llama-index-llms-replicate/tests/test_llms_replicate.py
index f1abf03ec2..3f1a5cdef6 100644
--- a/llama-index-integrations/llms/llama-index-llms-replicate/tests/test_llms_replicate.py
+++ b/llama-index-integrations/llms/llama-index-llms-replicate/tests/test_llms_replicate.py
@@ -1,4 +1,4 @@
-from llama_index.core.llms.base import BaseLLM
+from llama_index.core.base.llms.base import BaseLLM
 from llama_index.llms.replicate import Replicate
 
 
diff --git a/llama-index-integrations/llms/llama-index-llms-rungpt/tests/test_llms_rungpt.py b/llama-index-integrations/llms/llama-index-llms-rungpt/tests/test_llms_rungpt.py
index d3c5febaba..a5e9ae5d56 100644
--- a/llama-index-integrations/llms/llama-index-llms-rungpt/tests/test_llms_rungpt.py
+++ b/llama-index-integrations/llms/llama-index-llms-rungpt/tests/test_llms_rungpt.py
@@ -1,4 +1,4 @@
-from llama_index.core.llms.base import BaseLLM
+from llama_index.core.base.llms.base import BaseLLM
 from llama_index.llms.rungpt import RunGptLLM
 
 
diff --git a/llama-index-integrations/llms/llama-index-llms-sagemaker-endpoint/llama_index/llms/sagemaker_endpoint/base.py b/llama-index-integrations/llms/llama-index-llms-sagemaker-endpoint/llama_index/llms/sagemaker_endpoint/base.py
index 1f0d5bc1ba..e423417506 100644
--- a/llama-index-integrations/llms/llama-index-llms-sagemaker-endpoint/llama_index/llms/sagemaker_endpoint/base.py
+++ b/llama-index-integrations/llms/llama-index-llms-sagemaker-endpoint/llama_index/llms/sagemaker_endpoint/base.py
@@ -16,7 +16,7 @@ from llama_index.core.llms.callbacks import (
     llm_chat_callback,
     llm_completion_callback,
 )
-from llama_index.core.llms.generic_utils import (
+from llama_index.core.base.llms.generic_utils import (
     completion_response_to_chat_response,
     stream_completion_response_to_chat_response,
 )
diff --git a/llama-index-integrations/llms/llama-index-llms-sagemaker-endpoint/tests/test_llms_sagemaker_endpoint.py b/llama-index-integrations/llms/llama-index-llms-sagemaker-endpoint/tests/test_llms_sagemaker_endpoint.py
index e3406679c0..867e28213d 100644
--- a/llama-index-integrations/llms/llama-index-llms-sagemaker-endpoint/tests/test_llms_sagemaker_endpoint.py
+++ b/llama-index-integrations/llms/llama-index-llms-sagemaker-endpoint/tests/test_llms_sagemaker_endpoint.py
@@ -1,4 +1,4 @@
-from llama_index.core.llms.base import BaseLLM
+from llama_index.core.base.llms.base import BaseLLM
 from llama_index.llms.sagemaker_endpoint import SageMakerLLM
 
 
diff --git a/llama-index-integrations/llms/llama-index-llms-together/tests/test_llms_together.py b/llama-index-integrations/llms/llama-index-llms-together/tests/test_llms_together.py
index eee087d905..a93b4d8939 100644
--- a/llama-index-integrations/llms/llama-index-llms-together/tests/test_llms_together.py
+++ b/llama-index-integrations/llms/llama-index-llms-together/tests/test_llms_together.py
@@ -1,4 +1,4 @@
-from llama_index.core.llms.base import BaseLLM
+from llama_index.core.base.llms.base import BaseLLM
 from llama_index.llms.together import TogetherLLM
 
 
diff --git a/llama-index-integrations/llms/llama-index-llms-vertex/tests/test_llms_vertex.py b/llama-index-integrations/llms/llama-index-llms-vertex/tests/test_llms_vertex.py
index b9d9e2fc99..5bb1e9987c 100644
--- a/llama-index-integrations/llms/llama-index-llms-vertex/tests/test_llms_vertex.py
+++ b/llama-index-integrations/llms/llama-index-llms-vertex/tests/test_llms_vertex.py
@@ -1,4 +1,4 @@
-from llama_index.core.llms.base import BaseLLM
+from llama_index.core.base.llms.base import BaseLLM
 from llama_index.llms.vertex import Vertex
 
 
diff --git a/llama-index-integrations/llms/llama-index-llms-vllm/llama_index/llms/vllm/base.py b/llama-index-integrations/llms/llama-index-llms-vllm/llama_index/llms/vllm/base.py
index 93c795871b..c1c7098777 100644
--- a/llama-index-integrations/llms/llama-index-llms-vllm/llama_index/llms/vllm/base.py
+++ b/llama-index-integrations/llms/llama-index-llms-vllm/llama_index/llms/vllm/base.py
@@ -14,11 +14,11 @@ from llama_index.core.base.llms.types import (
 from llama_index.core.bridge.pydantic import Field, PrivateAttr
 from llama_index.core.callbacks import CallbackManager
 from llama_index.core.llms.callbacks import llm_chat_callback, llm_completion_callback
-from llama_index.core.llms.generic_utils import (
+from llama_index.core.base.llms.generic_utils import (
     completion_response_to_chat_response,
     stream_completion_response_to_chat_response,
 )
-from llama_index.core.llms.generic_utils import (
+from llama_index.core.base.llms.generic_utils import (
     messages_to_prompt as generic_messages_to_prompt,
 )
 from llama_index.core.llms.llm import LLM
diff --git a/llama-index-integrations/llms/llama-index-llms-vllm/tests/test_llms_vllm.py b/llama-index-integrations/llms/llama-index-llms-vllm/tests/test_llms_vllm.py
index 04dac87b8c..1be18dd2d4 100644
--- a/llama-index-integrations/llms/llama-index-llms-vllm/tests/test_llms_vllm.py
+++ b/llama-index-integrations/llms/llama-index-llms-vllm/tests/test_llms_vllm.py
@@ -1,4 +1,4 @@
-from llama_index.core.llms.base import BaseLLM
+from llama_index.core.base.llms.base import BaseLLM
 from llama_index.llms.vllm import Vllm
 
 
diff --git a/llama-index-integrations/llms/llama-index-llms-watsonx/llama_index/llms/watsonx/base.py b/llama-index-integrations/llms/llama-index-llms-watsonx/llama_index/llms/watsonx/base.py
index e62df096a0..3573b59cd5 100644
--- a/llama-index-integrations/llms/llama-index-llms-watsonx/llama_index/llms/watsonx/base.py
+++ b/llama-index-integrations/llms/llama-index-llms-watsonx/llama_index/llms/watsonx/base.py
@@ -14,7 +14,7 @@ from llama_index.core.base.llms.types import (
 from llama_index.core.bridge.pydantic import Field, PrivateAttr
 from llama_index.core.callbacks import CallbackManager
 from llama_index.core.llms.callbacks import llm_chat_callback, llm_completion_callback
-from llama_index.core.llms.generic_utils import (
+from llama_index.core.base.llms.generic_utils import (
     completion_to_chat_decorator,
     stream_completion_to_chat_decorator,
 )
diff --git a/llama-index-integrations/llms/llama-index-llms-watsonx/tests/test_llms_watsonx.py b/llama-index-integrations/llms/llama-index-llms-watsonx/tests/test_llms_watsonx.py
index 6342caea8e..df2f3c652d 100644
--- a/llama-index-integrations/llms/llama-index-llms-watsonx/tests/test_llms_watsonx.py
+++ b/llama-index-integrations/llms/llama-index-llms-watsonx/tests/test_llms_watsonx.py
@@ -1,4 +1,4 @@
-from llama_index.core.llms.base import BaseLLM
+from llama_index.core.base.llms.base import BaseLLM
 from llama_index.llms.watsonx import WatsonX
 
 
diff --git a/llama-index-integrations/llms/llama-index-llms-xinference/tests/test_llms_xinference.py b/llama-index-integrations/llms/llama-index-llms-xinference/tests/test_llms_xinference.py
index 3b73ff1d3f..a9877230e9 100644
--- a/llama-index-integrations/llms/llama-index-llms-xinference/tests/test_llms_xinference.py
+++ b/llama-index-integrations/llms/llama-index-llms-xinference/tests/test_llms_xinference.py
@@ -1,4 +1,4 @@
-from llama_index.core.llms.base import BaseLLM
+from llama_index.core.base.llms.base import BaseLLM
 from llama_index.llms.xinference import Xinference
 
 
diff --git a/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-azure-openai/llama_index/multi_modal_llms/azure_openai/base.py b/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-azure-openai/llama_index/multi_modal_llms/azure_openai/base.py
index 270585d2b1..b5a9a89200 100644
--- a/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-azure-openai/llama_index/multi_modal_llms/azure_openai/base.py
+++ b/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-azure-openai/llama_index/multi_modal_llms/azure_openai/base.py
@@ -8,7 +8,7 @@ from llama_index.core.constants import (
     DEFAULT_NUM_OUTPUTS,
     DEFAULT_TEMPERATURE,
 )
-from llama_index.core.llms.generic_utils import get_from_param_or_env
+from llama_index.core.base.llms.generic_utils import get_from_param_or_env
 from llama_index.core.multi_modal_llms import MultiModalLLMMetadata
 from llama_index.llms.azure_openai.utils import (
     refresh_openai_azuread_token,
diff --git a/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-openai/llama_index/multi_modal_llms/openai/base.py b/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-openai/llama_index/multi_modal_llms/openai/base.py
index 5bde0f3619..fed2ffb1a8 100644
--- a/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-openai/llama_index/multi_modal_llms/openai/base.py
+++ b/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-openai/llama_index/multi_modal_llms/openai/base.py
@@ -18,7 +18,7 @@ from llama_index.core.constants import (
     DEFAULT_NUM_OUTPUTS,
     DEFAULT_TEMPERATURE,
 )
-from llama_index.core.llms.generic_utils import (
+from llama_index.core.base.llms.generic_utils import (
     messages_to_prompt as generic_messages_to_prompt,
 )
 from llama_index.core.multi_modal_llms import (
diff --git a/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-replicate-multi-modal/llama_index/multi_modal_llms/replicate_multi_modal/base.py b/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-replicate-multi-modal/llama_index/multi_modal_llms/replicate_multi_modal/base.py
index 340b4e36f6..734c9a3e9f 100644
--- a/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-replicate-multi-modal/llama_index/multi_modal_llms/replicate_multi_modal/base.py
+++ b/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-replicate-multi-modal/llama_index/multi_modal_llms/replicate_multi_modal/base.py
@@ -13,7 +13,7 @@ from llama_index.core.base.llms.types import (
 from llama_index.core.bridge.pydantic import Field, PrivateAttr
 from llama_index.core.callbacks import CallbackManager
 from llama_index.core.constants import DEFAULT_CONTEXT_WINDOW, DEFAULT_NUM_OUTPUTS
-from llama_index.core.llms.generic_utils import (
+from llama_index.core.base.llms.generic_utils import (
     messages_to_prompt as generic_messages_to_prompt,
 )
 from llama_index.core.multi_modal_llms import (
diff --git a/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-replicate/llama_index/multi_modal_llms/replicate/base.py b/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-replicate/llama_index/multi_modal_llms/replicate/base.py
index 340b4e36f6..734c9a3e9f 100644
--- a/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-replicate/llama_index/multi_modal_llms/replicate/base.py
+++ b/llama-index-integrations/multi_modal_llms/llama-index-multi-modal-llms-replicate/llama_index/multi_modal_llms/replicate/base.py
@@ -13,7 +13,7 @@ from llama_index.core.base.llms.types import (
 from llama_index.core.bridge.pydantic import Field, PrivateAttr
 from llama_index.core.callbacks import CallbackManager
 from llama_index.core.constants import DEFAULT_CONTEXT_WINDOW, DEFAULT_NUM_OUTPUTS
-from llama_index.core.llms.generic_utils import (
+from llama_index.core.base.llms.generic_utils import (
     messages_to_prompt as generic_messages_to_prompt,
 )
 from llama_index.core.multi_modal_llms import (
diff --git a/poetry.lock b/poetry.lock
index a8e64e28c1..66f8e3491c 100644
--- a/poetry.lock
+++ b/poetry.lock
@@ -1502,13 +1502,13 @@ llama-index-llms-openai = ">=0.1.1,<0.2.0"
 
 [[package]]
 name = "llama-index-core"
-version = "0.10.7"
+version = "0.10.8.post1"
 description = "Interface between LLMs and your data"
 optional = false
 python-versions = ">=3.8.1,<4.0"
 files = [
-    {file = "llama_index_core-0.10.7-py3-none-any.whl", hash = "sha256:0dd1ec2878451d75d4644757cc24c8533d83a6c62ffa2ac0a4f1745a31cbb1ad"},
-    {file = "llama_index_core-0.10.7.tar.gz", hash = "sha256:d02f92128ce285110e953ed116a3db1ba02eec508d11ccdca14a851ece5eaead"},
+    {file = "llama_index_core-0.10.8.post1-py3-none-any.whl", hash = "sha256:51b736b22818cb0b117a1486be54cf05f9496e79feb5de7262be5ec5480d85ec"},
+    {file = "llama_index_core-0.10.8.post1.tar.gz", hash = "sha256:449fdd206901ca1e403b0c7fd021e52f9f0aa6fd121793f3062c442429a11ffd"},
 ]
 
 [package.dependencies]
@@ -4264,4 +4264,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p
 [metadata]
 lock-version = "2.0"
 python-versions = ">=3.8.1,<3.12"
-content-hash = "712557a4f68621c668730fdc56f1a225def91772af558b7279a081426c0de646"
+content-hash = "f1f95484f87927a6eed40e388280e01e1fb44cd987b310542a60e21420522e6e"
diff --git a/pyproject.toml b/pyproject.toml
index 889e1a6d92..103a8a41de 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -57,7 +57,7 @@ llama-index-agent-openai = "^0.1.0"
 llama-index-readers-file = "^0.1.0"
 llama-index-readers-llama-parse = "^0.1.0"
 llama-index-indices-managed-llama-cloud = "^0.1.0"
-llama-index-core = "^0.10.0"
+llama-index-core = "^0.10.8.post1"
 llama-index-multi-modal-llms-openai = "^0.1.0"
 
 [tool.poetry.group.dev.dependencies]
-- 
GitLab