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-ollama/llama_index/llms/ollama/base.py | llama-index-integrations/llms/llama-index-llms-ollama/llama_index/llms/ollama/base.py | from typing import (
TYPE_CHECKING,
Any,
AsyncGenerator,
Dict,
Generator,
List,
Literal,
Optional,
Sequence,
Tuple,
Type,
Union,
cast,
)
from ollama import AsyncClient, Client
from llama_index.core.base.llms.generic_utils import (
achat_to_completion_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-portkey/tests/test_llms_portkey.py | llama-index-integrations/llms/llama-index-llms-portkey/tests/test_llms_portkey.py | from llama_index.core.base.llms.base import BaseLLM
from llama_index.llms.portkey import Portkey
def test_embedding_class():
names_of_base_classes = [b.__name__ for b in Portkey.__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-portkey/tests/__init__.py | llama-index-integrations/llms/llama-index-llms-portkey/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-portkey/llama_index/llms/portkey/utils.py | llama-index-integrations/llms/llama-index-llms-portkey/llama_index/llms/portkey/utils.py | """
Utility Tools for the Portkey Class.
This file module contains a collection of utility functions designed to enhance
the functionality and usability of the Portkey class
"""
from typing import TYPE_CHECKING, List
from llama_index.core.base.llms.types import LLMMetadata
from llama_index.llms.anthropic import Anth... | 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-portkey/llama_index/llms/portkey/__init__.py | llama-index-integrations/llms/llama-index-llms-portkey/llama_index/llms/portkey/__init__.py | from llama_index.llms.portkey.base import Portkey
__all__ = ["Portkey"]
| 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-portkey/llama_index/llms/portkey/base.py | llama-index-integrations/llms/llama-index-llms-portkey/llama_index/llms/portkey/base.py | """
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 (
ChatMessage,
ChatResponse,
ChatResponseGen,
CompletionResponse,
CompletionResponseGen,
LLM... | 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-sglang/tests/test_llms_sglang.py | llama-index-integrations/llms/llama-index-llms-sglang/tests/test_llms_sglang.py | from llama_index.core.base.llms.base import BaseLLM
from llama_index.core.base.llms.types import ChatMessage, MessageRole
from llama_index.llms.sglang import SGLang
def test_llm_class():
names_of_base_classes = [b.__name__ for b in SGLang.__mro__]
assert BaseLLM.__name__ in names_of_base_classes
from unitte... | 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-sglang/tests/__init__.py | llama-index-integrations/llms/llama-index-llms-sglang/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-sglang/llama_index/llms/sglang/utils.py | llama-index-integrations/llms/llama-index-llms-sglang/llama_index/llms/sglang/utils.py | import json
from typing import Iterable, List
import requests
def get_response(response: requests.Response) -> List[str]:
"""Extract text from SGLang API response."""
data = json.loads(response.content)
# Handle OpenAI-compatible format with choices array
if isinstance(data, dict) and "choices" in d... | 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-sglang/llama_index/llms/sglang/__init__.py | llama-index-integrations/llms/llama-index-llms-sglang/llama_index/llms/sglang/__init__.py | from llama_index.llms.sglang.base import SGLang
__all__ = ["SGLang"]
| 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-sglang/llama_index/llms/sglang/base.py | llama-index-integrations/llms/llama-index-llms-sglang/llama_index/llms/sglang/base.py | import json
from typing import Any, Callable, Dict, List, Optional, Sequence
from llama_index.core.base.llms.generic_utils import (
completion_response_to_chat_response,
)
from llama_index.core.base.llms.generic_utils import (
messages_to_prompt as generic_messages_to_prompt,
)
from llama_index.core.base.llms.... | 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-zhipuai/tests/conftest.py | llama-index-integrations/llms/llama-index-llms-zhipuai/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-zhipuai/tests/__init__.py | llama-index-integrations/llms/llama-index-llms-zhipuai/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-zhipuai/tests/test_llms_zhipuai.py | llama-index-integrations/llms/llama-index-llms-zhipuai/tests/test_llms_zhipuai.py | import os
import pytest
from unittest import mock
from zhipuai.types.chat.chat_completion import (
Completion,
CompletionChoice,
CompletionMessage,
CompletionUsage,
)
from llama_index.core.base.llms.types import CompletionResponse
from llama_index.core.base.llms.base import BaseLLM
from llama_index.llms... | 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-zhipuai/llama_index/llms/zhipuai/__init__.py | llama-index-integrations/llms/llama-index-llms-zhipuai/llama_index/llms/zhipuai/__init__.py | from llama_index.llms.zhipuai.base import ZhipuAI
__all__ = ["ZhipuAI"]
| 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-zhipuai/llama_index/llms/zhipuai/base.py | llama-index-integrations/llms/llama-index-llms-zhipuai/llama_index/llms/zhipuai/base.py | import asyncio
import json
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Sequence, Union
from zhipuai import ZhipuAI as ZhipuAIClient
from llama_index.core.base.llms.types import (
ChatMessage,
ChatResponse,
ChatResponseGen,
ChatResponseAsyncGen,
CompletionResponse,
CompletionResp... | 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-helicone/tests/test_llms_helicone.py | llama-index-integrations/llms/llama-index-llms-helicone/tests/test_llms_helicone.py | from unittest.mock import MagicMock
from llama_index.core.base.llms.base import BaseLLM
from llama_index.core.base.llms.types import ChatMessage, MessageRole
from llama_index.llms.helicone import Helicone
from llama_index.llms.helicone.base import DEFAULT_API_BASE, DEFAULT_MODEL
def test_llm_class_inheritance():
... | 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-helicone/tests/__init__.py | llama-index-integrations/llms/llama-index-llms-helicone/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-helicone/llama_index/llms/helicone/__init__.py | llama-index-integrations/llms/llama-index-llms-helicone/llama_index/llms/helicone/__init__.py | from llama_index.llms.helicone.base import Helicone
__all__ = ["Helicone"]
| 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-helicone/llama_index/llms/helicone/base.py | llama-index-integrations/llms/llama-index-llms-helicone/llama_index/llms/helicone/base.py | from typing import Any, Dict, Optional
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 llama_index.llms.openai_like import OpenAILike
# Defaul... | 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-replicate/tests/test_llms_replicate.py | llama-index-integrations/llms/llama-index-llms-replicate/tests/test_llms_replicate.py | from llama_index.core.base.llms.base import BaseLLM
from llama_index.llms.replicate import Replicate
def test_embedding_class():
names_of_base_classes = [b.__name__ for b in Replicate.__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-replicate/tests/__init__.py | llama-index-integrations/llms/llama-index-llms-replicate/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-replicate/llama_index/llms/replicate/__init__.py | llama-index-integrations/llms/llama-index-llms-replicate/llama_index/llms/replicate/__init__.py | from llama_index.llms.replicate.base import Replicate
__all__ = ["Replicate"]
| 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-replicate/llama_index/llms/replicate/base.py | llama-index-integrations/llms/llama-index-llms-replicate/llama_index/llms/replicate/base.py | from typing import Any, Dict, Sequence
from llama_index.core.base.llms.types import (
ChatMessage,
ChatResponse,
ChatResponseGen,
CompletionResponse,
CompletionResponseGen,
LLMMetadata,
)
from llama_index.core.bridge.pydantic import Field
from llama_index.core.constants import DEFAULT_CONTEXT_W... | 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-perplexity/tests/test_llms_perplexity.py | llama-index-integrations/llms/llama-index-llms-perplexity/tests/test_llms_perplexity.py | from llama_index.core.base.llms.base import BaseLLM
from llama_index.llms.perplexity import Perplexity
def test_embedding_class():
names_of_base_classes = [b.__name__ for b in Perplexity.__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-perplexity/tests/conftest.py | llama-index-integrations/llms/llama-index-llms-perplexity/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-perplexity/tests/test_perplexity.py | llama-index-integrations/llms/llama-index-llms-perplexity/tests/test_perplexity.py | import inspect
import os
from collections.abc import AsyncGenerator, AsyncIterator
from unittest.mock import AsyncMock, patch
import pytest
from tenacity import RetryError
from llama_index.core.base.llms.types import (
ChatMessage,
ChatResponse,
CompletionResponse,
MessageRole,
)
from llama_index.llms... | 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-perplexity/tests/__init__.py | llama-index-integrations/llms/llama-index-llms-perplexity/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-perplexity/llama_index/llms/perplexity/__init__.py | llama-index-integrations/llms/llama-index-llms-perplexity/llama_index/llms/perplexity/__init__.py | from llama_index.llms.perplexity.base import Perplexity
__all__ = ["Perplexity"]
| 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-perplexity/llama_index/llms/perplexity/base.py | llama-index-integrations/llms/llama-index-llms-perplexity/llama_index/llms/perplexity/base.py | import json
from collections.abc import Callable, Sequence
from typing import Any, Optional
from os import getenv
import aiohttp
import httpx
import requests
from tenacity import retry, stop_after_attempt, wait_fixed
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-litellm/tests/test_utils.py | llama-index-integrations/llms/llama-index-llms-litellm/tests/test_utils.py | from llama_index.llms.litellm.utils import (
openai_modelname_to_contextsize,
to_openai_message_dicts,
update_tool_calls,
to_openailike_message_dict,
from_openai_message_dict,
from_litellm_message,
)
from llama_index.core.base.llms.types import (
ChatMessage,
MessageRole,
TextBlock,
... | 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-litellm/tests/test_llms_litellm.py | llama-index-integrations/llms/llama-index-llms-litellm/tests/test_llms_litellm.py | from decimal import Decimal
import httpx
from llama_index.core.base.llms.base import BaseLLM
import pytest
import respx
import os
from unittest.mock import patch
from llama_index.llms.litellm import LiteLLM
from llama_index.core.llms import ChatMessage
from llama_index.core.tools import FunctionTool
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-litellm/tests/conftest.py | llama-index-integrations/llms/llama-index-llms-litellm/tests/conftest.py | # there's a rather large issue with the pants build, it's only running tests
# with sources that are imported, which causes pytest markers to not be registered
# so we need to import pytest_asyncio manually here to ensure that the markers
# are registered
import pytest_asyncio # noqa: F401
# Set the default fixture l... | 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-litellm/tests/__init__.py | llama-index-integrations/llms/llama-index-llms-litellm/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-litellm/llama_index/llms/litellm/utils.py | llama-index-integrations/llms/llama-index-llms-litellm/llama_index/llms/litellm/utils.py | import logging
from typing import Any, Callable, Dict, List, Optional, Sequence, Type, Union
from llama_index.core.base.llms.types import ChatMessage
from llama_index.core.bridge.pydantic import BaseModel
from openai.resources import Completions
from tenacity import (
before_sleep_log,
retry,
retry_if_exce... | 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-litellm/llama_index/llms/litellm/__init__.py | llama-index-integrations/llms/llama-index-llms-litellm/llama_index/llms/litellm/__init__.py | from llama_index.llms.litellm.base import LiteLLM
__all__ = ["LiteLLM"]
| 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-litellm/llama_index/llms/litellm/base.py | llama-index-integrations/llms/llama-index-llms-litellm/llama_index/llms/litellm/base.py | import json
import uuid
from json import JSONDecodeError
from typing import (
Any,
Awaitable,
Callable,
Dict,
Optional,
Sequence,
List,
Union,
)
from llama_index.core.base.llms.types import (
ChatMessage,
ChatResponse,
ChatResponseAsyncGen,
ChatResponseGen,
Completio... | 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-paieas/tests/__init__.py | llama-index-integrations/llms/llama-index-llms-paieas/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-paieas/tests/test_llms_paieas.py | llama-index-integrations/llms/llama-index-llms-paieas/tests/test_llms_paieas.py | import os
import pytest
from llama_index.core.base.llms.base import BaseLLM
from llama_index.core.base.llms.types import ChatMessage
from llama_index.llms.paieas import PaiEas
should_skip = os.environ.get("PAIEAS_API_KEY", None) is None
def test_text_inference_embedding_class():
names_of_base_classes = [b.__nam... | 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-paieas/llama_index/llms/paieas/__init__.py | llama-index-integrations/llms/llama-index-llms-paieas/llama_index/llms/paieas/__init__.py | from llama_index.llms.paieas.base import PaiEas
__all__ = ["PaiEas"]
| 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-paieas/llama_index/llms/paieas/base.py | llama-index-integrations/llms/llama-index-llms-paieas/llama_index/llms/paieas/base.py | import os
from typing import Any, Optional
from urllib.parse import urljoin
from llama_index.llms.openai_like import OpenAILike
DEFAULT_MODEL_NAME = "default"
class PaiEas(OpenAILike):
"""
PaiEas is a thin wrapper around the OpenAILike model that makes it compatible with
Aliyun PAI-EAS(Elastic Algorithm... | 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-cerebras/tests/test_llms_cerebras.py | llama-index-integrations/llms/llama-index-llms-cerebras/tests/test_llms_cerebras.py | from llama_index.core.base.llms.base import BaseLLM
from llama_index.llms.cerebras import Cerebras
def test_text_inference_embedding_class():
names_of_base_classes = [b.__name__ for b in Cerebras.__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-cerebras/tests/__init__.py | llama-index-integrations/llms/llama-index-llms-cerebras/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-cerebras/tests/test_integration_cerebras.py | llama-index-integrations/llms/llama-index-llms-cerebras/tests/test_integration_cerebras.py | import os
import pytest
from llama_index.llms.cerebras import Cerebras
@pytest.mark.skipif("CEREBRAS_API_KEY" not in os.environ, reason="No Cerebras API key")
def test_completion():
cerebras = Cerebras(model="llama3.1-8b")
resp = cerebras.complete("What color is the sky? Answer in one word.")
assert res... | 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-cerebras/llama_index/llms/cerebras/__init__.py | llama-index-integrations/llms/llama-index-llms-cerebras/llama_index/llms/cerebras/__init__.py | from llama_index.llms.cerebras.base import Cerebras
__all__ = ["Cerebras"]
| 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-cerebras/llama_index/llms/cerebras/base.py | llama-index-integrations/llms/llama-index-llms-cerebras/llama_index/llms/cerebras/base.py | import os
from typing import Any, Optional
from llama_index.llms.openai_like import OpenAILike
class Cerebras(OpenAILike):
"""
Cerebras LLM.
Examples:
`pip install llama-index-llms-cerebras`
```python
from llama_index.llms.cerebras import Cerebras
# Set up the Cerebras ... | 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-konko/tests/test_llms_konko.py | llama-index-integrations/llms/llama-index-llms-konko/tests/test_llms_konko.py | from llama_index.core.base.llms.base import BaseLLM
from llama_index.llms.konko import Konko
def test_embedding_class():
names_of_base_classes = [b.__name__ for b in Konko.__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-konko/tests/__init__.py | llama-index-integrations/llms/llama-index-llms-konko/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-konko/llama_index/llms/konko/utils.py | llama-index-integrations/llms/llama-index-llms-konko/llama_index/llms/konko/utils.py | import logging
from importlib.metadata import version
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.base.llms.generic_utils import get_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-konko/llama_index/llms/konko/__init__.py | llama-index-integrations/llms/llama-index-llms-konko/llama_index/llms/konko/__init__.py | from llama_index.llms.konko.base import Konko
__all__ = ["Konko"]
| 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-konko/llama_index/llms/konko/base.py | llama-index-integrations/llms/llama-index-llms-konko/llama_index/llms/konko/base.py | from dataclasses import dataclass
from typing import Any, Awaitable, Callable, Dict, Optional, Sequence
from llama_index.core.base.llms.types import (
ChatMessage,
ChatResponse,
ChatResponseAsyncGen,
ChatResponseGen,
CompletionResponse,
CompletionResponseAsyncGen,
CompletionResponseGen,
... | 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-anyscale/tests/test_llms_anyscale.py | llama-index-integrations/llms/llama-index-llms-anyscale/tests/test_llms_anyscale.py | from llama_index.core.base.llms.base import BaseLLM
from llama_index.llms.anyscale import Anyscale
def test_text_inference_embedding_class():
names_of_base_classes = [b.__name__ for b in Anyscale.__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-anyscale/tests/__init__.py | llama-index-integrations/llms/llama-index-llms-anyscale/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-anyscale/llama_index/llms/anyscale/utils.py | llama-index-integrations/llms/llama-index-llms-anyscale/llama_index/llms/anyscale/utils.py | from typing import Any, Dict, List, Optional, Sequence, Tuple
from llama_index.core.base.llms.types import ChatMessage, MessageRole
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 = ""
LLAMA_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-anyscale/llama_index/llms/anyscale/__init__.py | llama-index-integrations/llms/llama-index-llms-anyscale/llama_index/llms/anyscale/__init__.py | from llama_index.llms.anyscale.base import Anyscale
__all__ = ["Anyscale"]
| 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-anyscale/llama_index/llms/anyscale/base.py | llama-index-integrations/llms/llama-index-llms-anyscale/llama_index/llms/anyscale/base.py | 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.base.llms.generic_utils import ge... | 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-openvino/llama_index/llms/openvino/__init__.py | llama-index-integrations/llms/llama-index-llms-openvino/llama_index/llms/openvino/__init__.py | from llama_index.llms.openvino.base import OpenVINOLLM
__all__ = ["OpenVINOLLM"]
| 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-openvino/llama_index/llms/openvino/base.py | llama-index-integrations/llms/llama-index-llms-openvino/llama_index/llms/openvino/base.py | import logging
from typing import Any, Callable, List, Optional, Sequence, Union
from pathlib import Path
from huggingface_hub import HfApi
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... | 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-cohere/tests/test_llms_cohere.py | llama-index-integrations/llms/llama-index-llms-cohere/tests/test_llms_cohere.py | import os
from typing import Sequence, Optional, List
from unittest import mock
import pytest
from cohere import ChatbotMessage, UserMessage, NonStreamedChatResponse, ToolCall
from llama_index.core.base.llms.base import BaseLLM
from llama_index.core.base.llms.types import ChatResponse, ChatMessage, MessageRole
from l... | 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-cohere/tests/__init__.py | llama-index-integrations/llms/llama-index-llms-cohere/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-cohere/tests/test_rag_inference.py | llama-index-integrations/llms/llama-index-llms-cohere/tests/test_rag_inference.py | import pytest
from llama_index.core.prompts import MessageRole
from llama_index.llms.cohere import DocumentMessage
from llama_index.llms.cohere.utils import document_message_to_cohere_document
text1 = "birds flying high"
text2 = "sun in the sky"
text3 = "breeze driftin' on by"
text4 = "fish in the sea"
text5 = "river... | 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-cohere/llama_index/llms/cohere/utils.py | llama-index-integrations/llms/llama-index-llms-cohere/llama_index/llms/cohere/utils.py | from collections import Counter
import logging
from typing import (
Any,
Callable,
Dict,
List,
Mapping,
MutableMapping,
Optional,
Sequence,
Tuple,
Type,
Union,
)
import re
from pydantic import BaseModel
from llama_index.core.base.llms.base import BaseLLM
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-cohere/llama_index/llms/cohere/__init__.py | llama-index-integrations/llms/llama-index-llms-cohere/llama_index/llms/cohere/__init__.py | from llama_index.llms.cohere.base import Cohere
from llama_index.llms.cohere.utils import (
COHERE_QA_TEMPLATE,
COHERE_REFINE_TEMPLATE,
COHERE_TREE_SUMMARIZE_TEMPLATE,
COHERE_REFINE_TABLE_CONTEXT_PROMPT,
DocumentMessage,
is_cohere_model,
)
__all__ = [
"COHERE_QA_TEMPLATE",
"COHERE_REFIN... | 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-cohere/llama_index/llms/cohere/base.py | llama-index-integrations/llms/llama-index-llms-cohere/llama_index/llms/cohere/base.py | import warnings
from typing import Any, Callable, Dict, List, Optional, Sequence, Union
from llama_index.core.base.llms.types import (
ChatMessage,
ChatResponse,
ChatResponseAsyncGen,
ChatResponseGen,
CompletionResponse,
CompletionResponseAsyncGen,
CompletionResponseGen,
LLMMetadata,
... | 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-ipex-llm/examples/basic.py | llama-index-integrations/llms/llama-index-llms-ipex-llm/examples/basic.py | # Transform a string into input zephyr-specific input
def completion_to_prompt(completion):
return f"<|system|>\n</s>\n<|user|>\n{completion}</s>\n<|assistant|>\n"
# Transform a list of chat messages into zephyr-specific input
def messages_to_prompt(messages):
prompt = ""
for message in messages:
... | 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-ipex-llm/examples/low_bit.py | llama-index-integrations/llms/llama-index-llms-ipex-llm/examples/low_bit.py | def completion_to_prompt(completion):
return f"<|system|>\n</s>\n<|user|>\n{completion}</s>\n<|assistant|>\n"
# Transform a list of chat messages into zephyr-specific input
def messages_to_prompt(messages):
prompt = ""
for message in messages:
if message.role == "system":
prompt += f"<... | 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-ipex-llm/examples/more_data_type.py | llama-index-integrations/llms/llama-index-llms-ipex-llm/examples/more_data_type.py | import argparse
from llama_index.llms.ipex_llm import IpexLLM
# Transform a string into input llama2-specific input
def completion_to_prompt(completion):
return f"<s>[INST] <<SYS>>\n \n<</SYS>>\n\n{completion} [/INST]"
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="More Data 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-ipex-llm/llama_index/llms/ipex_llm/__init__.py | llama-index-integrations/llms/llama-index-llms-ipex-llm/llama_index/llms/ipex_llm/__init__.py | from llama_index.llms.ipex_llm.base import IpexLLM
__all__ = ["IpexLLM"]
| 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-ipex-llm/llama_index/llms/ipex_llm/base.py | llama-index-integrations/llms/llama-index-llms-ipex-llm/llama_index/llms/ipex_llm/base.py | # This file is adapted from
# https://github.com/run-llama/llama_index/blob/main/llama-index-integrations/
# llms/llama-index-llms-huggingface/llama_index/llms/huggingface/base.py
import logging
from typing import Any, Callable, List, Optional, Sequence
import torch
from llama_index.core.base.llms.types import (
... | 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-friendli/tests/test_llms_friendli.py | llama-index-integrations/llms/llama-index-llms-friendli/tests/test_llms_friendli.py | from llama_index.core.base.llms.base import BaseLLM
from llama_index.llms.friendli import Friendli
def test_embedding_class():
names_of_base_classes = [b.__name__ for b in Friendli.__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-friendli/tests/__init__.py | llama-index-integrations/llms/llama-index-llms-friendli/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-friendli/llama_index/llms/friendli/utils.py | llama-index-integrations/llms/llama-index-llms-friendli/llama_index/llms/friendli/utils.py | from typing import Any, Dict, Sequence
from llama_index.core.base.llms.types import ChatMessage
LLAMA_MODELS = {
"llama-2-13b-chat": 4096,
"llama-2-70b-chat": 4096,
}
MISTRAL_MODELS = {
"mistral-7b-instruct-v0-2": 32768,
"mixtral-8x7b-instruct-v0-1": 32768,
}
GEMMA_MODELS = {
"gemma-7b-it": 8192... | 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-friendli/llama_index/llms/friendli/__init__.py | llama-index-integrations/llms/llama-index-llms-friendli/llama_index/llms/friendli/__init__.py | from llama_index.llms.friendli.base import Friendli
__all__ = ["Friendli"]
| 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-friendli/llama_index/llms/friendli/base.py | llama-index-integrations/llms/llama-index-llms-friendli/llama_index/llms/friendli/base.py | from typing import Any, Callable, Dict, Optional, Sequence
from llama_index.core.base.llms.types import (
ChatMessage,
ChatResponse,
ChatResponseAsyncGen,
ChatResponseGen,
CompletionResponse,
CompletionResponseAsyncGen,
CompletionResponseGen,
LLMMetadata,
MessageRole,
)
from llama_i... | 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-modelscope/tests/test_modelscope.py | llama-index-integrations/llms/llama-index-llms-modelscope/tests/test_modelscope.py | import pytest
from llama_index.core.base.llms.types import (
ChatMessage,
MessageRole,
)
from llama_index.llms.modelscope.base import ModelScopeLLM
@pytest.fixture()
def modelscope_llm():
return ModelScopeLLM()
@pytest.fixture()
def prompt():
return "Hi, my name is"
@pytest.fixture()
def messages(... | 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-modelscope/tests/__init__.py | llama-index-integrations/llms/llama-index-llms-modelscope/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-modelscope/llama_index/llms/modelscope/utils.py | llama-index-integrations/llms/llama-index-llms-modelscope/llama_index/llms/modelscope/utils.py | from typing import Dict, Sequence
from llama_index.core.base.llms.types import (
ChatResponse,
CompletionResponse,
ChatMessage,
)
def chat_message_to_modelscope_messages(
chat_messages: Sequence[ChatMessage],
) -> Dict:
messages = []
for msg in chat_messages:
messages.append({"role": ... | 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-modelscope/llama_index/llms/modelscope/__init__.py | llama-index-integrations/llms/llama-index-llms-modelscope/llama_index/llms/modelscope/__init__.py | from llama_index.llms.modelscope.base import ModelScopeLLM
__all__ = ["ModelScopeLLM"]
| 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-modelscope/llama_index/llms/modelscope/base.py | llama-index-integrations/llms/llama-index-llms-modelscope/llama_index/llms/modelscope/base.py | import logging
from typing import Any, Optional, Sequence
import torch
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_... | 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-cloudflare-ai-gateway/tests/test_cloudflare_ai_gateway.py | llama-index-integrations/llms/llama-index-llms-cloudflare-ai-gateway/tests/test_cloudflare_ai_gateway.py | import os
import pytest
from dotenv import load_dotenv
from llama_index.core.llms import ChatMessage
from llama_index.llms.cloudflare_ai_gateway import CloudflareAIGateway
# Load .env file
load_dotenv()
@pytest.mark.skipif(
not all(
[
os.getenv("OPENAI_API_KEY"),
os.getenv("ANTHRO... | 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-cloudflare-ai-gateway/tests/__init__.py | llama-index-integrations/llms/llama-index-llms-cloudflare-ai-gateway/tests/__init__.py | # Tests for Cloudflare AI Gateway LLM integration
| 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-cloudflare-ai-gateway/llama_index/llms/cloudflare_ai_gateway/providers.py | llama-index-integrations/llms/llama-index-llms-cloudflare-ai-gateway/llama_index/llms/cloudflare_ai_gateway/providers.py | import re
from typing import Any, Callable, Dict, List, Optional
from llama_index.core.base.llms.types import ChatMessage
from llama_index.core.llms import LLM
class ProviderConfig:
"""Configuration for an AI provider."""
def __init__(
self,
name: str,
regex: str,
transform_e... | 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-cloudflare-ai-gateway/llama_index/llms/cloudflare_ai_gateway/__init__.py | llama-index-integrations/llms/llama-index-llms-cloudflare-ai-gateway/llama_index/llms/cloudflare_ai_gateway/__init__.py | from llama_index.llms.cloudflare_ai_gateway.base import (
CloudflareAIGateway,
CloudflareAIGatewayError,
CloudflareAIGatewayUnauthorizedError,
CloudflareAIGatewayDoesNotExistError,
CloudflareAIGatewayOptions,
)
__all__ = [
"CloudflareAIGateway",
"CloudflareAIGatewayError",
"CloudflareAI... | 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-cloudflare-ai-gateway/llama_index/llms/cloudflare_ai_gateway/base.py | llama-index-integrations/llms/llama-index-llms-cloudflare-ai-gateway/llama_index/llms/cloudflare_ai_gateway/base.py | """
Cloudflare AI Gateway LLM integration.
This module provides integration with Cloudflare AI Gateway, allowing you to
use multiple AI models from different providers with automatic fallback.
"""
import json
from typing import Any, Dict, List, Optional, Sequence, Union
import logging
import httpx
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-qianfan/tests/test_llms_qianfan.py | llama-index-integrations/llms/llama-index-llms-qianfan/tests/test_llms_qianfan.py | import json
import asyncio
from unittest.mock import patch, MagicMock
import httpx
from llama_index.core.base.llms.types import (
ChatMessage,
MessageRole,
)
from llama_index.llms.qianfan import Qianfan
# The request and response messages come from:
# https://cloud.baidu.com/doc/WENXINWORKSHOP/s/4lqoklvr1
# h... | 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-qianfan/tests/__init__.py | llama-index-integrations/llms/llama-index-llms-qianfan/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-qianfan/llama_index/llms/qianfan/__init__.py | llama-index-integrations/llms/llama-index-llms-qianfan/llama_index/llms/qianfan/__init__.py | from llama_index.llms.qianfan.base import Qianfan
__all__ = ["Qianfan"]
| 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-qianfan/llama_index/llms/qianfan/base.py | llama-index-integrations/llms/llama-index-llms-qianfan/llama_index/llms/qianfan/base.py | from typing import Any, Dict, Sequence, List, Literal, Iterable, AsyncIterable
from llama_index.core.bridge.pydantic import BaseModel, Field, PrivateAttr
from llama_index.core.base.llms.types import (
ChatMessage,
ChatResponse,
ChatResponseGen,
ChatResponseAsyncGen,
LLMMetadata,
MessageRole,
... | 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-llamafile/tests/__init__.py | llama-index-integrations/llms/llama-index-llms-llamafile/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-llamafile/tests/test_llms_llamafile.py | llama-index-integrations/llms/llama-index-llms-llamafile/tests/test_llms_llamafile.py | from llama_index.core.base.llms.base import BaseLLM
from llama_index.llms.llamafile import Llamafile
from pytest import MonkeyPatch
import httpx
from json import dumps as json_dumps
import io
from collections import deque
from contextlib import contextmanager
from llama_index.core.base.llms.types import (
ChatMessa... | 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-llamafile/llama_index/llms/llamafile/__init__.py | llama-index-integrations/llms/llama-index-llms-llamafile/llama_index/llms/llamafile/__init__.py | from llama_index.llms.llamafile.base import Llamafile
__all__ = ["Llamafile"]
| 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-llamafile/llama_index/llms/llamafile/base.py | llama-index-integrations/llms/llama-index-llms-llamafile/llama_index/llms/llamafile/base.py | import io
import json
from typing import Any, Dict, Sequence, Tuple
import httpx
from httpx import Timeout
from llama_index.core.base.llms.types import (
ChatMessage,
ChatResponse,
CompletionResponse,
CompletionResponseGen,
LLMMetadata,
MessageRole,
)
from llama_index.core.bridge.pydantic impo... | 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-siliconflow/tests/test_llms_siliconflow.py | llama-index-integrations/llms/llama-index-llms-siliconflow/tests/test_llms_siliconflow.py | import json
import pytest
import types
from typing import Optional, Type
from unittest import mock
from requests import Response
from llama_index.core.base.llms.base import BaseLLM
from llama_index.core.base.llms.types import (
CompletionResponse,
ChatMessage,
MessageRole,
)
from llama_index.llms.siliconflo... | 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-siliconflow/tests/conftest.py | llama-index-integrations/llms/llama-index-llms-siliconflow/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-siliconflow/tests/__init__.py | llama-index-integrations/llms/llama-index-llms-siliconflow/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-siliconflow/llama_index/llms/siliconflow/__init__.py | llama-index-integrations/llms/llama-index-llms-siliconflow/llama_index/llms/siliconflow/__init__.py | from llama_index.llms.siliconflow.base import SiliconFlow
__all__ = ["SiliconFlow"]
| 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-siliconflow/llama_index/llms/siliconflow/base.py | llama-index-integrations/llms/llama-index-llms-siliconflow/llama_index/llms/siliconflow/base.py | import json
import aiohttp
import functools
import requests
import tenacity
import asyncio
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
List,
Optional,
Sequence,
Union,
cast,
)
from llama_index.core.base.llms.types import (
ChatMessage,
ChatResponse,
ChatRespo... | 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-openai-like/tests/test_openai_like_grok.py | llama-index-integrations/llms/llama-index-llms-openai-like/tests/test_openai_like_grok.py | import os
from typing import Any
from pydantic import BaseModel
from llama_index.llms.openai_like import OpenAILike
import pytest
SKIP_GROK = os.environ.get("GROK_API_KEY") is None
class Answer(BaseModel):
"""A simple answer."""
answer: str
# Define the models to test against
GROK: list[dict[str, Any]] =... | 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-openai-like/tests/test_llms_openai_like.py | llama-index-integrations/llms/llama-index-llms-openai-like/tests/test_llms_openai_like.py | from llama_index.core.base.llms.base import BaseLLM
from llama_index.llms.openai_like import OpenAILike
def test_embedding_class():
names_of_base_classes = [b.__name__ for b in OpenAILike.__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-openai-like/tests/__init__.py | llama-index-integrations/llms/llama-index-llms-openai-like/tests/__init__.py | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.