repo
stringlengths
7
90
file_url
stringlengths
81
315
file_path
stringlengths
4
228
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 14:38:15
2026-01-05 02:33:18
truncated
bool
2 classes
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-baseten/llama_index/llms/baseten/utils.py
llama-index-integrations/llms/llama-index-llms-baseten/llama_index/llms/baseten/utils.py
from typing import List import warnings from llama_index.core.bridge.pydantic import BaseModel # https://docs.baseten.co/development/model-apis/overview#supported-models # Below is the current list of models supported by Baseten model APIs. # Other dedicated models are also supported, but not listed here. SUPPORTED_MO...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-baseten/llama_index/llms/baseten/__init__.py
llama-index-integrations/llms/llama-index-llms-baseten/llama_index/llms/baseten/__init__.py
from llama_index.llms.baseten.base import Baseten __all__ = ["Baseten"]
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-baseten/llama_index/llms/baseten/base.py
llama-index-integrations/llms/llama-index-llms-baseten/llama_index/llms/baseten/base.py
from typing import Any, Callable, Dict, List, Optional, Sequence import aiohttp from llama_index.core.base.llms.types import ( ChatMessage, CompletionResponse, LLMMetadata, ) from llama_index.core.callbacks import CallbackManager from llama_index.core.constants import DEFAULT_NUM_OUTPUTS, DEFAULT_TEMPERATUR...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-llama-cpp/tests/test_llms_llama_cpp.py
llama-index-integrations/llms/llama-index-llms-llama-cpp/tests/test_llms_llama_cpp.py
from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.llama_cpp import LlamaCPP from llama_index.core.base.llms.types import ChatMessage, MessageRole from llama_index.llms.llama_cpp.llama_utils import ( messages_to_prompt_v3_instruct, completion_to_prompt_v3_instruct, ) def test_embedding_...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-llama-cpp/tests/__init__.py
llama-index-integrations/llms/llama-index-llms-llama-cpp/tests/__init__.py
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-llama-cpp/llama_index/llms/llama_cpp/llama_utils.py
llama-index-integrations/llms/llama-index-llms-llama-cpp/llama_index/llms/llama_cpp/llama_utils.py
from typing import List, Optional, Sequence from llama_index.core.base.llms.types import ChatMessage, MessageRole BOS, EOS = "<s>", "</s>" B_INST, E_INST = "[INST]", "[/INST]" B_SYS, E_SYS = "<<SYS>>\n", "\n<</SYS>>\n\n" DEFAULT_SYSTEM_PROMPT = """\ You are a helpful, respectful and honest assistant. \ Always answer ...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-llama-cpp/llama_index/llms/llama_cpp/__init__.py
llama-index-integrations/llms/llama-index-llms-llama-cpp/llama_index/llms/llama_cpp/__init__.py
from llama_index.llms.llama_cpp.base import LlamaCPP __all__ = ["LlamaCPP"]
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-llama-cpp/llama_index/llms/llama_cpp/base.py
llama-index-integrations/llms/llama-index-llms-llama-cpp/llama_index/llms/llama_cpp/base.py
import os from typing import Any, Callable, Dict, Optional, Sequence import requests from llama_index.core.base.llms.types import ( ChatMessage, ChatResponse, ChatResponseGen, CompletionResponse, CompletionResponseGen, LLMMetadata, ) from llama_index.core.bridge.pydantic import Field, PrivateAt...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-rungpt/tests/test_llms_rungpt.py
llama-index-integrations/llms/llama-index-llms-rungpt/tests/test_llms_rungpt.py
from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.rungpt import RunGptLLM def test_embedding_class(): names_of_base_classes = [b.__name__ for b in RunGptLLM.__mro__] assert BaseLLM.__name__ in names_of_base_classes
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-rungpt/tests/__init__.py
llama-index-integrations/llms/llama-index-llms-rungpt/tests/__init__.py
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-rungpt/llama_index/llms/rungpt/__init__.py
llama-index-integrations/llms/llama-index-llms-rungpt/llama_index/llms/rungpt/__init__.py
from llama_index.llms.rungpt.base import RunGptLLM __all__ = ["RunGptLLM"]
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-rungpt/llama_index/llms/rungpt/base.py
llama-index-integrations/llms/llama-index-llms-rungpt/llama_index/llms/rungpt/base.py
from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union from llama_index.core.base.llms.types import ( ChatMessage, ChatResponse, ChatResponseAsyncGen, ChatResponseGen, CompletionResponse, CompletionResponseAsyncGen, CompletionResponseGen, LLMMetadata, Message...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-cometapi/tests/__init__.py
llama-index-integrations/llms/llama-index-llms-cometapi/tests/__init__.py
# Empty init file for tests
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-cometapi/tests/test_llms_cometapi.py
llama-index-integrations/llms/llama-index-llms-cometapi/tests/test_llms_cometapi.py
from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.cometapi import CometAPI def test_embedding_class(): names_of_base_classes = [b.__name__ for b in CometAPI.__mro__] assert BaseLLM.__name__ in names_of_base_classes def test_cometapi_initialization(): llm = CometAPI(model="gpt-4o-...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-cometapi/llama_index/llms/cometapi/__init__.py
llama-index-integrations/llms/llama-index-llms-cometapi/llama_index/llms/cometapi/__init__.py
from llama_index.llms.cometapi.base import CometAPI __all__ = ["CometAPI"]
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-cometapi/llama_index/llms/cometapi/base.py
llama-index-integrations/llms/llama-index-llms-cometapi/llama_index/llms/cometapi/base.py
from typing import Any, Dict, Optional from llama_index.core.base.llms.types import LLMMetadata from llama_index.core.bridge.pydantic import Field from llama_index.core.constants import ( DEFAULT_CONTEXT_WINDOW, DEFAULT_NUM_OUTPUTS, DEFAULT_TEMPERATURE, ) from llama_index.core.base.llms.generic_utils impor...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-oci-data-science/tests/test_llms_oci_data_science.py
llama-index-integrations/llms/llama-index-llms-oci-data-science/tests/test_llms_oci_data_science.py
from unittest.mock import AsyncMock, Mock import pytest from llama_index.core.base.llms.types import ChatMessage, ChatResponse, MessageRole from llama_index.core.callbacks import CallbackManager from llama_index.core.llms.function_calling import FunctionCallingLLM from llama_index.core.tools.types import BaseTool from...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-oci-data-science/tests/conftest.py
llama-index-integrations/llms/llama-index-llms-oci-data-science/tests/conftest.py
# pants requires this import to recognize the dep import pytest_asyncio # noqa: F401
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-oci-data-science/tests/test_oci_data_science_utils.py
llama-index-integrations/llms/llama-index-llms-oci-data-science/tests/test_oci_data_science_utils.py
import pytest from llama_index.core.base.llms.types import ChatMessage, LogProb, MessageRole from llama_index.llms.oci_data_science.utils import ( UnsupportedOracleAdsVersionError, _from_completion_logprobs_dict, _from_message_dict, _from_token_logprob_dicts, _get_response_token_counts, _resolve...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-oci-data-science/tests/__init__.py
llama-index-integrations/llms/llama-index-llms-oci-data-science/tests/__init__.py
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-oci-data-science/tests/test_oci_data_science_client.py
llama-index-integrations/llms/llama-index-llms-oci-data-science/tests/test_oci_data_science_client.py
import json from contextlib import asynccontextmanager from unittest.mock import AsyncMock, MagicMock, Mock, patch import httpx import pytest from llama_index.llms.oci_data_science.client import ( AsyncClient, BaseClient, Client, ExtendedRequestException, OCIAuth, _create_retry_decorator, _...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-oci-data-science/llama_index/llms/oci_data_science/client.py
llama-index-integrations/llms/llama-index-llms-oci-data-science/llama_index/llms/oci_data_science/client.py
import asyncio import functools import json import logging import time from abc import ABC from types import TracebackType from typing import ( Any, AsyncIterator, Callable, Dict, Iterator, List, Mapping, Optional, Tuple, TypeVar, Union, ) import httpx import oci import requ...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-oci-data-science/llama_index/llms/oci_data_science/utils.py
llama-index-integrations/llms/llama-index-llms-oci-data-science/llama_index/llms/oci_data_science/utils.py
import logging from functools import wraps from typing import Any, Callable, Dict, List, Optional, Sequence, Union from llama_index.core.base.llms.types import ChatMessage, LogProb from packaging import version MIN_ADS_VERSION = "2.12.6" SUPPORTED_TOOL_CHOICES = ["none", "auto", "required"] DEFAULT_TOOL_CHOICE = "aut...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-oci-data-science/llama_index/llms/oci_data_science/__init__.py
llama-index-integrations/llms/llama-index-llms-oci-data-science/llama_index/llms/oci_data_science/__init__.py
from llama_index.llms.oci_data_science.base import OCIDataScience __all__ = ["OCIDataScience"]
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-oci-data-science/llama_index/llms/oci_data_science/base.py
llama-index-integrations/llms/llama-index-llms-oci-data-science/llama_index/llms/oci_data_science/base.py
import logging from typing import Any, Callable, Dict, List, Optional, Sequence, Union, TYPE_CHECKING import llama_index.core.instrumentation as instrument from llama_index.core.base.llms.types import ( ChatMessage, ChatResponse, ChatResponseAsyncGen, ChatResponseGen, CompletionResponse, Comple...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
true
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-lmstudio/tests/test_llms_lmstudio.py
llama-index-integrations/llms/llama-index-llms-lmstudio/tests/test_llms_lmstudio.py
from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.lmstudio import LMStudio def test_embedding_class(): names_of_base_classes = [b.__name__ for b in LMStudio.__mro__] assert BaseLLM.__name__ in names_of_base_classes
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-lmstudio/tests/__init__.py
llama-index-integrations/llms/llama-index-llms-lmstudio/tests/__init__.py
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-lmstudio/llama_index/llms/lmstudio/__init__.py
llama-index-integrations/llms/llama-index-llms-lmstudio/llama_index/llms/lmstudio/__init__.py
from llama_index.llms.lmstudio.base import LMStudio __all__ = ["LMStudio"]
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-lmstudio/llama_index/llms/lmstudio/base.py
llama-index-integrations/llms/llama-index-llms-lmstudio/llama_index/llms/lmstudio/base.py
import logging import json import httpx from httpx import Timeout from typing import Any, Dict, Sequence, Tuple from llama_index.core.bridge.pydantic import Field from llama_index.core.llms.callbacks import llm_chat_callback, llm_completion_callback from llama_index.core.llms.custom import CustomLLM from llama_index.c...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-llama-api/tests/test_llms_llama_api.py
llama-index-integrations/llms/llama-index-llms-llama-api/tests/test_llms_llama_api.py
from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.llama_api import LlamaAPI def test_embedding_class(): names_of_base_classes = [b.__name__ for b in LlamaAPI.__mro__] assert BaseLLM.__name__ in names_of_base_classes
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-llama-api/tests/__init__.py
llama-index-integrations/llms/llama-index-llms-llama-api/tests/__init__.py
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-llama-api/llama_index/llms/llama_api/__init__.py
llama-index-integrations/llms/llama-index-llms-llama-api/llama_index/llms/llama_api/__init__.py
from llama_index.llms.llama_api.base import LlamaAPI __all__ = ["LlamaAPI"]
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-llama-api/llama_index/llms/llama_api/base.py
llama-index-integrations/llms/llama-index-llms-llama-api/llama_index/llms/llama_api/base.py
from llama_index.core.base.llms.types import ( LLMMetadata, ) from llama_index.core.bridge.pydantic import Field from llama_index.llms.openai_like import OpenAILike class LlamaAPI(OpenAILike): """ LlamaAPI LLM. Examples: `pip install llama-index-llms-llama-api` ```python from...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-alephalpha/tests/test_llms_alephalpha.py
llama-index-integrations/llms/llama-index-llms-alephalpha/tests/test_llms_alephalpha.py
from unittest.mock import MagicMock, patch from llama_index.llms.alephalpha.base import AlephAlpha from llama_index.llms.alephalpha.utils import extract_additional_info_from_response def test_alephalpha_instantiation(): model = "luminous-base" token = "test_token" aleph_alpha_instance = AlephAlpha(model=...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-alephalpha/tests/__init__.py
llama-index-integrations/llms/llama-index-llms-alephalpha/tests/__init__.py
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-alephalpha/llama_index/llms/alephalpha/utils.py
llama-index-integrations/llms/llama-index-llms-alephalpha/llama_index/llms/alephalpha/utils.py
from typing import Dict, Any from llama_index.core.base.llms.types import LogProb, CompletionResponse HUMAN_PREFIX = "\n\nHuman:" ASSISTANT_PREFIX = "\n\nAssistant:" LUMINOUS_MODELS: Dict[str, int] = { "luminous-base": 2048, "luminous-extended": 2048, "luminous-supreme": 2048, "luminous-base-control"...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-alephalpha/llama_index/llms/alephalpha/__init__.py
llama-index-integrations/llms/llama-index-llms-alephalpha/llama_index/llms/alephalpha/__init__.py
from llama_index.llms.alephalpha.base import AlephAlpha __all__ = ["AlephAlpha"]
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-alephalpha/llama_index/llms/alephalpha/base.py
llama-index-integrations/llms/llama-index-llms-alephalpha/llama_index/llms/alephalpha/base.py
from typing import Any, Dict, Optional, Sequence, List from aleph_alpha_client import Prompt, CompletionRequest, Client, AsyncClient from llama_index.core.base.llms.generic_utils import get_from_param_or_env from llama_index.core.base.llms.types import ( ChatMessage, ChatResponse, CompletionResponse, C...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-asi/tests/test_integration_asi.py
llama-index-integrations/llms/llama-index-llms-asi/tests/test_integration_asi.py
import os import pytest from llama_index.llms.asi import ASI @pytest.mark.skipif("ASI_API_KEY" not in os.environ, reason="No ASI API key") def test_completion(): # Test basic completion asi = ASI(model="asi1-mini", temperature=0, max_tokens=10) resp = asi.complete("hello") assert resp.text.strip() !=...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-asi/tests/conftest.py
llama-index-integrations/llms/llama-index-llms-asi/tests/conftest.py
# pants requires this import to recognize the dep import pytest_asyncio # noqa: F401
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-asi/tests/test_llms_asi.py
llama-index-integrations/llms/llama-index-llms-asi/tests/test_llms_asi.py
import os from unittest.mock import MagicMock, patch import pytest from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.openai.base import ChatMessage, MessageRole from llama_index.llms.asi import ASI def test_embedding_class(): names_of_base_classes = [b.__name__ for b in ASI.__mro__] ...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-asi/tests/__init__.py
llama-index-integrations/llms/llama-index-llms-asi/tests/__init__.py
# Tests package
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-asi/llama_index/llms/asi/__init__.py
llama-index-integrations/llms/llama-index-llms-asi/llama_index/llms/asi/__init__.py
"""ASI LLM package.""" from llama_index.llms.asi.base import ASI __all__ = ["ASI"]
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-asi/llama_index/llms/asi/base.py
llama-index-integrations/llms/llama-index-llms-asi/llama_index/llms/asi/base.py
"""ASI LLM implementation.""" import os from typing import Any, Optional, Sequence from llama_index.llms.openai_like import OpenAILike from llama_index.llms.openai.base import ( ChatMessage, ChatResponseGen, ChatResponseAsyncGen, ChatResponse, MessageRole, ) DEFAULT_MODEL = "asi1-mini" class AS...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-mistral-rs/tests/test_llms_mistral-rs.py
llama-index-integrations/llms/llama-index-llms-mistral-rs/tests/test_llms_mistral-rs.py
from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.mistral_rs import MistralRS def test_llm_class(): names_of_base_classes = [b.__name__ for b in MistralRS.__mro__] assert BaseLLM.__name__ in names_of_base_classes
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-mistral-rs/tests/__init__.py
llama-index-integrations/llms/llama-index-llms-mistral-rs/tests/__init__.py
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-mistral-rs/llama_index/llms/mistral_rs/__init__.py
llama-index-integrations/llms/llama-index-llms-mistral-rs/llama_index/llms/mistral_rs/__init__.py
from llama_index.llms.mistral_rs.base import MistralRS __all__ = ["MistralRS"]
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-mistral-rs/llama_index/llms/mistral_rs/base.py
llama-index-integrations/llms/llama-index-llms-mistral-rs/llama_index/llms/mistral_rs/base.py
from typing import Any, Callable, Dict, Optional, Sequence, List, TYPE_CHECKING from llama_index.core.base.llms.types import ( ChatMessage, ChatResponse, ChatResponseGen, CompletionResponse, CompletionResponseGen, LLMMetadata, MessageRole, LogProb, ) from llama_index.core.bridge.pydanti...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-contextual/tests/__init__.py
llama-index-integrations/llms/llama-index-llms-contextual/tests/__init__.py
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-contextual/tests/test_empty.py
llama-index-integrations/llms/llama-index-llms-contextual/tests/test_empty.py
from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.contextual import Contextual def test_llm_class(): names_of_base_classes = [b.__name__ for b in Contextual.__mro__] assert BaseLLM.__name__ in names_of_base_classes
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-contextual/llama_index/llms/contextual/__init__.py
llama-index-integrations/llms/llama-index-llms-contextual/llama_index/llms/contextual/__init__.py
from llama_index.llms.contextual.base import Contextual __all__ = ["Contextual"]
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-contextual/llama_index/llms/contextual/base.py
llama-index-integrations/llms/llama-index-llms-contextual/llama_index/llms/contextual/base.py
from typing import Any, Optional from llama_index.llms.openai_like import OpenAILike from pydantic import Field from typing import List, Sequence from llama_index.core.llms.callbacks import ( llm_chat_callback, llm_completion_callback, ) from llama_index.core.base.llms.types import ( CompletionResponse, ...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-xinference/tests/__init__.py
llama-index-integrations/llms/llama-index-llms-xinference/tests/__init__.py
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-xinference/tests/test_llms_xinference.py
llama-index-integrations/llms/llama-index-llms-xinference/tests/test_llms_xinference.py
from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.xinference import Xinference def test_embedding_class(): names_of_base_classes = [b.__name__ for b in Xinference.__mro__] assert BaseLLM.__name__ in names_of_base_classes
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-xinference/llama_index/llms/xinference/utils.py
llama-index-integrations/llms/llama-index-llms-xinference/llama_index/llms/xinference/utils.py
from typing import Optional from llama_index.core.base.llms.types import ChatMessage from typing_extensions import NotRequired, TypedDict XINFERENCE_MODEL_SIZES = { "baichuan": 2048, "baichuan-chat": 2048, "wizardlm-v1.0": 2048, "vicuna-v1.3": 2048, "orca": 2048, "chatglm": 2048, "chatglm2...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-xinference/llama_index/llms/xinference/__init__.py
llama-index-integrations/llms/llama-index-llms-xinference/llama_index/llms/xinference/__init__.py
from llama_index.llms.xinference.base import Xinference __all__ = ["Xinference"]
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-xinference/llama_index/llms/xinference/base.py
llama-index-integrations/llms/llama-index-llms-xinference/llama_index/llms/xinference/base.py
import warnings from typing import Any, Callable, Dict, Optional, Sequence, Tuple from llama_index.core.base.llms.types import ( ChatMessage, ChatResponse, ChatResponseGen, CompletionResponse, CompletionResponseGen, LLMMetadata, MessageRole, ) from llama_index.core.bridge.pydantic import Fi...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-gaudi/examples/basic.py
llama-index-integrations/llms/llama-index-llms-gaudi/examples/basic.py
import os, logging import argparse from llama_index.llms.gaudi import GaudiLLM from llama_index.core.prompts import PromptTemplate logging.basicConfig( format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO, ) logger = logging.getLogger(__name__) de...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-gaudi/llama_index/llms/gaudi/utils.py
llama-index-integrations/llms/llama-index-llms-gaudi/llama_index/llms/gaudi/utils.py
# Copyright 2022 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-gaudi/llama_index/llms/gaudi/__init__.py
llama-index-integrations/llms/llama-index-llms-gaudi/llama_index/llms/gaudi/__init__.py
from llama_index.llms.gaudi.base import GaudiLLM __all__ = ["GaudiLLM"]
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-gaudi/llama_index/llms/gaudi/base.py
llama-index-integrations/llms/llama-index-llms-gaudi/llama_index/llms/gaudi/base.py
import logging from typing import Any, Callable, List, Optional, Sequence, Union from llama_index.core.base.llms.types import ChatMessage from llama_index.core.bridge.pydantic import Field from llama_index.llms.huggingface.base import HuggingFaceLLM from llama_index.core.callbacks import CallbackManager from llama_ind...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-neutrino/tests/__init__.py
llama-index-integrations/llms/llama-index-llms-neutrino/tests/__init__.py
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-neutrino/tests/test_llms_neutrino.py
llama-index-integrations/llms/llama-index-llms-neutrino/tests/test_llms_neutrino.py
from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.neutrino import Neutrino def test_embedding_class(): names_of_base_classes = [b.__name__ for b in Neutrino.__mro__] assert BaseLLM.__name__ in names_of_base_classes
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-neutrino/llama_index/llms/neutrino/__init__.py
llama-index-integrations/llms/llama-index-llms-neutrino/llama_index/llms/neutrino/__init__.py
from llama_index.llms.neutrino.base import Neutrino __all__ = ["Neutrino"]
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-neutrino/llama_index/llms/neutrino/base.py
llama-index-integrations/llms/llama-index-llms-neutrino/llama_index/llms/neutrino/base.py
from typing import Any, Dict, Optional from llama_index.core.base.llms.types import LLMMetadata from llama_index.core.bridge.pydantic import Field from llama_index.core.constants import ( DEFAULT_NUM_OUTPUTS, DEFAULT_TEMPERATURE, ) from llama_index.core.base.llms.generic_utils import get_from_param_or_env from...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-huggingface/tests/__init__.py
llama-index-integrations/llms/llama-index-llms-huggingface/tests/__init__.py
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-huggingface/tests/test_llms_huggingface.py
llama-index-integrations/llms/llama-index-llms-huggingface/tests/test_llms_huggingface.py
from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.huggingface import HuggingFaceLLM def test_embedding_class(): names_of_base_classes = [b.__name__ for b in HuggingFaceLLM.__mro__] assert BaseLLM.__name__ in names_of_base_classes
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-huggingface/llama_index/llms/huggingface/utils.py
llama-index-integrations/llms/llama-index-llms-huggingface/llama_index/llms/huggingface/utils.py
import requests from packaging import version from typing import Union, List, Optional from llama_index.core.base.llms.types import ( ChatResponse, ) def get_max_input_tokens(url: str) -> Union[int, None]: url = f"{url}/info" model_info = dict(requests.get(url).json()) tgi_version = model_info.get("ve...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-huggingface/llama_index/llms/huggingface/__init__.py
llama-index-integrations/llms/llama-index-llms-huggingface/llama_index/llms/huggingface/__init__.py
from llama_index.llms.huggingface.base import ( HuggingFaceLLM, ) __all__ = ["HuggingFaceLLM"]
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-huggingface/llama_index/llms/huggingface/base.py
llama-index-integrations/llms/llama-index-llms-huggingface/llama_index/llms/huggingface/base.py
import logging from typing import Any, Callable, List, Optional, Sequence, Union import torch from llama_index.core.base.llms.types import ( ChatMessage, ChatResponse, ChatResponseGen, CompletionResponse, CompletionResponseGen, LLMMetadata, ) from llama_index.core.bridge.pydantic import Field, ...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-gemini/tests/test_llms_gemini.py
llama-index-integrations/llms/llama-index-llms-gemini/tests/test_llms_gemini.py
import os import pytest from google.ai.generativelanguage_v1beta.types import ( FunctionCallingConfig, ToolConfig, ) from google.generativeai.types.content_types import FunctionCallingMode import google.generativeai as genai from llama_index.core.base.llms.base import BaseLLM from llama_index.core.base.llms.t...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-gemini/tests/__init__.py
llama-index-integrations/llms/llama-index-llms-gemini/tests/__init__.py
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-gemini/llama_index/llms/gemini/utils.py
llama-index-integrations/llms/llama-index-llms-gemini/llama_index/llms/gemini/utils.py
from typing import Union, Dict, Any import google.ai.generativelanguage as glm import google.generativeai as genai from llama_index.core.base.llms.types import ( ChatMessage, ChatResponse, CompletionResponse, ImageBlock, TextBlock, ) from llama_index.core.multi_modal_llms.base import ChatMessage fr...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-gemini/llama_index/llms/gemini/__init__.py
llama-index-integrations/llms/llama-index-llms-gemini/llama_index/llms/gemini/__init__.py
from llama_index.llms.gemini.base import Gemini __all__ = ["Gemini"]
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-gemini/llama_index/llms/gemini/base.py
llama-index-integrations/llms/llama-index-llms-gemini/llama_index/llms/gemini/base.py
"""Google's hosted Gemini API.""" import deprecated import os import uuid import warnings from typing import ( TYPE_CHECKING, Any, AsyncGenerator, Dict, Generator, List, Optional, Sequence, Type, Union, cast, ) import google.generativeai as genai from google.generativeai.typ...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-mlx/llama_index/llms/mlx/tokenizer_utils.py
llama-index-integrations/llms/llama-index-llms-mlx/llama_index/llms/mlx/tokenizer_utils.py
import json from functools import partial from transformers import AutoTokenizer REPLACEMENT_CHAR = "\ufffd" def _remove_space(x): if x and x[0] == " ": return x[1:] return x class StreamingDetokenizer: """ The streaming detokenizer interface so that we can detokenize one token at a time. ...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-mlx/llama_index/llms/mlx/utils.py
llama-index-integrations/llms/llama-index-llms-mlx/llama_index/llms/mlx/utils.py
from datetime import time from typing import Dict, Optional, Tuple, Generator, Union, Callable, Any import mlx.core as mx import mlx.nn as nn from .tokenizer_utils import TokenizerWrapper from transformers import PreTrainedTokenizer def apply_repetition_penalty(logits: mx.array, generated_tokens: Any, penalty: float...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-mlx/llama_index/llms/mlx/__init__.py
llama-index-integrations/llms/llama-index-llms-mlx/llama_index/llms/mlx/__init__.py
from llama_index.llms.mlx.base import MLXLLM __all__ = ["MLXLLM"]
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-mlx/llama_index/llms/mlx/base.py
llama-index-integrations/llms/llama-index-llms-mlx/llama_index/llms/mlx/base.py
from .utils import gen_stream from llama_index.core.base.llms.types import ( ChatMessage, ChatResponse, ChatResponseGen, CompletionResponse, CompletionResponseGen, LLMMetadata, ) from llama_index.core.bridge.pydantic import Field, PrivateAttr from llama_index.core.callbacks import CallbackManag...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-azure-inference/tests/__init__.py
llama-index-integrations/llms/llama-index-llms-azure-inference/tests/__init__.py
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-azure-inference/tests/test_llms_azure_inference.py
llama-index-integrations/llms/llama-index-llms-azure-inference/tests/test_llms_azure_inference.py
import asyncio import json import logging import os from unittest import mock # import aiohttp to force Pants to include it in the required dependencies import aiohttp # noqa import pytest from azure.ai.inference.models import ( ChatChoice, ChatCompletions, ChatCompletionsToolChoicePreset, ChatRespons...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-azure-inference/llama_index/llms/azure_inference/__init__.py
llama-index-integrations/llms/llama-index-llms-azure-inference/llama_index/llms/azure_inference/__init__.py
from llama_index.llms.azure_inference.base import AzureAICompletionsModel __all__ = ["AzureAICompletionsModel"]
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-azure-inference/llama_index/llms/azure_inference/base.py
llama-index-integrations/llms/llama-index-llms-azure-inference/llama_index/llms/azure_inference/base.py
"""Azure AI model inference chat completions client.""" import json import logging from typing import ( Any, Callable, Dict, List, Optional, Sequence, Type, Union, TYPE_CHECKING, ) from llama_index.core.base.llms.types import ( ChatMessage, ChatResponse, ChatResponseAsy...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-anthropic/tests/test_llms_anthropic.py
llama-index-integrations/llms/llama-index-llms-anthropic/tests/test_llms_anthropic.py
import os import httpx from unittest.mock import MagicMock from typing import List import pytest from pathlib import Path from pydantic import BaseModel, ValidationError from anthropic.types.beta.parsed_beta_message import ParsedBetaMessage from anthropic.types.beta import BetaUsage from llama_index.core.prompts impor...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
true
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-anthropic/tests/test_anthropic_utils.py
llama-index-integrations/llms/llama-index-llms-anthropic/tests/test_anthropic_utils.py
import pytest from llama_index.llms.anthropic.utils import ( is_anthropic_prompt_caching_supported_model, ANTHROPIC_PROMPT_CACHING_SUPPORTED_MODELS, update_tool_calls, is_anthropic_structured_output_supported, STRUCTURED_OUTPUT_SUPPORT, messages_to_anthropic_beta_messages, ) from llama_index.co...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-anthropic/tests/conftest.py
llama-index-integrations/llms/llama-index-llms-anthropic/tests/conftest.py
# pants requires this import to recognize the dep import pytest_asyncio # noqa: F401
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-anthropic/tests/__init__.py
llama-index-integrations/llms/llama-index-llms-anthropic/tests/__init__.py
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-anthropic/llama_index/llms/anthropic/utils.py
llama-index-integrations/llms/llama-index-llms-anthropic/llama_index/llms/anthropic/utils.py
""" Utility functions for the Anthropic SDK LLM integration. """ from typing import Any, Dict, List, Sequence, Tuple, Optional, Literal, cast, Union from llama_index.core.base.llms.types import ( ChatMessage, ChatResponse, ImageBlock, MessageRole, TextBlock, DocumentBlock, CachePoint, ...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-anthropic/llama_index/llms/anthropic/__init__.py
llama-index-integrations/llms/llama-index-llms-anthropic/llama_index/llms/anthropic/__init__.py
from llama_index.llms.anthropic.base import Anthropic __all__ = ["Anthropic"]
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-anthropic/llama_index/llms/anthropic/base.py
llama-index-integrations/llms/llama-index-llms-anthropic/llama_index/llms/anthropic/base.py
import json import logging import llama_index.core.instrumentation as instrument from typing import ( TYPE_CHECKING, Any, Type, AsyncGenerator, Callable, Dict, Generator, List, Optional, Sequence, Set, Tuple, Union, cast, ) from llama_index.core.llms.utils import ...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
true
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-nvidia-triton/tests/test_llms_nvidia_triton.py
llama-index-integrations/llms/llama-index-llms-nvidia-triton/tests/test_llms_nvidia_triton.py
from llama_index.core.base.llms.base import BaseLLM from llama_index.llms.nvidia_triton import NvidiaTriton def test_text_inference_embedding_class(): names_of_base_classes = [b.__name__ for b in NvidiaTriton.__mro__] assert BaseLLM.__name__ in names_of_base_classes
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-nvidia-triton/tests/__init__.py
llama-index-integrations/llms/llama-index-llms-nvidia-triton/tests/__init__.py
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-nvidia-triton/llama_index/llms/nvidia_triton/utils.py
llama-index-integrations/llms/llama-index-llms-nvidia-triton/llama_index/llms/nvidia_triton/utils.py
# Copyright 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # * Redistributions of source code must retain the above copyright # notice, this list o...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-nvidia-triton/llama_index/llms/nvidia_triton/__init__.py
llama-index-integrations/llms/llama-index-llms-nvidia-triton/llama_index/llms/nvidia_triton/__init__.py
# Copyright 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # * Redistributions of source code must retain the above copyright # notice, this list o...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-nvidia-triton/llama_index/llms/nvidia_triton/base.py
llama-index-integrations/llms/llama-index-llms-nvidia-triton/llama_index/llms/nvidia_triton/base.py
# Copyright 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # * Redistributions of source code must retain the above copyright # notice, this list o...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-ollama/tests/test_utils.py
llama-index-integrations/llms/llama-index-llms-ollama/tests/test_utils.py
from llama_index.llms.ollama.base import get_additional_kwargs def test_get_additional_kwargs(): response = {"key1": "value1", "key2": "value2", "exclude_me": "value3"} exclude = ("exclude_me", "exclude_me_too") expected = {"key1": "value1", "key2": "value2"} actual = get_additional_kwargs(response,...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-ollama/tests/conftest.py
llama-index-integrations/llms/llama-index-llms-ollama/tests/conftest.py
# pants requires this import to recognize the dep import pytest_asyncio # noqa: F401
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-ollama/tests/__init__.py
llama-index-integrations/llms/llama-index-llms-ollama/tests/__init__.py
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-ollama/tests/test_llms_ollama.py
llama-index-integrations/llms/llama-index-llms-ollama/tests/test_llms_ollama.py
import os import pytest from ollama import Client from typing import Annotated from llama_index.core.base.llms.types import ThinkingBlock, TextBlock, ToolCallBlock from llama_index.core.base.llms.base import BaseLLM from llama_index.core.bridge.pydantic import BaseModel, Field from llama_index.core.llms import ChatMe...
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false
run-llama/llama_index
https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/llms/llama-index-llms-ollama/llama_index/llms/ollama/__init__.py
llama-index-integrations/llms/llama-index-llms-ollama/llama_index/llms/ollama/__init__.py
from llama_index.llms.ollama.base import Ollama __all__ = ["Ollama"]
python
MIT
dd5b31109cc8eb64411caf9fc1fa0f51e584c325
2026-01-04T14:39:40.052063Z
false