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
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/tests/unit_tests/migrate/__init__.py
libs/cli/tests/unit_tests/migrate/__init__.py
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/tests/unit_tests/migrate/generate/test_langchain_migration.py
libs/cli/tests/unit_tests/migrate/generate/test_langchain_migration.py
import pytest from langchain_classic._api import suppress_langchain_deprecation_warning as sup2 from langchain_core._api import suppress_langchain_deprecation_warning as sup1 from langchain_cli.namespaces.migrate.generate.generic import ( generate_simplified_migrations, ) @pytest.mark.xfail(reason="Unknown reaso...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/tests/unit_tests/migrate/generate/test_utils.py
libs/cli/tests/unit_tests/migrate/generate/test_utils.py
from langchain_cli.namespaces.migrate.generate.utils import PKGS_ROOT def test_root() -> None: if PKGS_ROOT.name != "libs": msg = "Expected PKGS_ROOT.name to be 'libs'." raise ValueError(msg)
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/tests/unit_tests/migrate/generate/test_partner_migrations.py
libs/cli/tests/unit_tests/migrate/generate/test_partner_migrations.py
import pytest from langchain_cli.namespaces.migrate.generate.partner import ( get_migrations_for_partner_package, ) pytest.importorskip(modname="langchain_openai") def test_generate_migrations() -> None: migrations = get_migrations_for_partner_package("langchain_openai") if migrations != [ ("lan...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/tests/unit_tests/migrate/generate/__init__.py
libs/cli/tests/unit_tests/migrate/generate/__init__.py
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/tests/unit_tests/migrate/cli_runner/file.py
libs/cli/tests/unit_tests/migrate/cli_runner/file.py
from __future__ import annotations class File: def __init__(self, name: str, content: list[str] | None = None) -> None: self.name = name self.content = "\n".join(content or []) def __eq__(self, __value: object, /) -> bool: if not isinstance(__value, File): return NotImplem...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/tests/unit_tests/migrate/cli_runner/case.py
libs/cli/tests/unit_tests/migrate/cli_runner/case.py
from __future__ import annotations from dataclasses import dataclass from typing import TYPE_CHECKING if TYPE_CHECKING: from .file import File from .folder import Folder @dataclass class Case: source: Folder | File expected: Folder | File name: str
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/tests/unit_tests/migrate/cli_runner/folder.py
libs/cli/tests/unit_tests/migrate/cli_runner/folder.py
from __future__ import annotations from typing import TYPE_CHECKING from .file import File if TYPE_CHECKING: from pathlib import Path class Folder: def __init__(self, name: str, *files: Folder | File) -> None: self.name = name self._files = files @property def files(self) -> list[F...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/tests/unit_tests/migrate/cli_runner/test_cli.py
libs/cli/tests/unit_tests/migrate/cli_runner/test_cli.py
from __future__ import annotations import difflib from pathlib import Path import pytest from typer.testing import CliRunner from langchain_cli.cli import app from tests.unit_tests.migrate.cli_runner.cases import before, expected from tests.unit_tests.migrate.cli_runner.folder import Folder pytest.importorskip("gri...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/tests/unit_tests/migrate/cli_runner/__init__.py
libs/cli/tests/unit_tests/migrate/cli_runner/__init__.py
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/tests/unit_tests/migrate/cli_runner/cases/imports.py
libs/cli/tests/unit_tests/migrate/cli_runner/cases/imports.py
from tests.unit_tests.migrate.cli_runner.case import Case from tests.unit_tests.migrate.cli_runner.file import File cases = [ Case( name="Imports", source=File( "app.py", content=[ "from langchain_community.chat_models import ChatOpenAI", "", ...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/tests/unit_tests/migrate/cli_runner/cases/imports_with_alias_changes.py
libs/cli/tests/unit_tests/migrate/cli_runner/cases/imports_with_alias_changes.py
"""Handle a test case where the import is updated and may involve an alias change.""" from tests.unit_tests.migrate.cli_runner.case import Case from tests.unit_tests.migrate.cli_runner.file import File # The test case right now make sure that if we update the import # of RunnableMap to RunnableParallel then the code ...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/tests/unit_tests/migrate/cli_runner/cases/__init__.py
libs/cli/tests/unit_tests/migrate/cli_runner/cases/__init__.py
from tests.unit_tests.migrate.cli_runner.case import Case from tests.unit_tests.migrate.cli_runner.cases import imports from tests.unit_tests.migrate.cli_runner.file import File from tests.unit_tests.migrate.cli_runner.folder import Folder cases = [ Case( name="empty", source=File("__init__.py", co...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/tests/integration_tests/test_compile.py
libs/cli/tests/integration_tests/test_compile.py
import pytest @pytest.mark.compile def test_placeholder() -> None: """Used for compiling integration tests without running any real tests."""
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/tests/integration_tests/__init__.py
libs/cli/tests/integration_tests/__init__.py
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/dev_scripts.py
libs/cli/langchain_cli/dev_scripts.py
"""Development Scripts for template packages.""" from collections.abc import Sequence from typing import Literal from fastapi import FastAPI from langserve import add_routes from langchain_cli.utils.packages import get_langserve_export, get_package_root def create_demo_server( *, config_keys: Sequence[str]...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/cli.py
libs/cli/langchain_cli/cli.py
"""LangChain CLI.""" from __future__ import annotations from typing import Annotated import typer from langchain_cli._version import __version__ from langchain_cli.namespaces import app as app_namespace from langchain_cli.namespaces import integration as integration_namespace from langchain_cli.namespaces import te...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/constants.py
libs/cli/langchain_cli/constants.py
"""LangChain CLI constants.""" DEFAULT_GIT_REPO = "https://github.com/langchain-ai/langchain.git" DEFAULT_GIT_SUBDIRECTORY = "templates" DEFAULT_GIT_REF = "master"
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/_version.py
libs/cli/langchain_cli/_version.py
from importlib import metadata try: __version__ = metadata.version(__package__) except metadata.PackageNotFoundError: # Case where package metadata is not available. __version__ = "" del metadata # optional, avoids polluting the results of dir(__package__) __all__ = ["__version__"]
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/__init__.py
libs/cli/langchain_cli/__init__.py
"""LangChain CLI.""" from langchain_cli._version import __version__ __all__ = [ "__version__", ]
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/integration_template/scripts/check_imports.py
libs/cli/langchain_cli/integration_template/scripts/check_imports.py
import sys import traceback from importlib.machinery import SourceFileLoader if __name__ == "__main__": files = sys.argv[1:] has_failure = False for file in files: try: SourceFileLoader("x", file).load_module() except Exception: has_failure = True print(f...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/integration_template/integration_template/chat_models.py
libs/cli/langchain_cli/integration_template/integration_template/chat_models.py
"""__ModuleName__ chat models.""" from typing import Any, Dict, Iterator, List from langchain_core.callbacks import ( CallbackManagerForLLMRun, ) from langchain_core.language_models import BaseChatModel from langchain_core.messages import ( AIMessage, AIMessageChunk, BaseMessage, ) from langchain_core...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/integration_template/integration_template/tools.py
libs/cli/langchain_cli/integration_template/integration_template/tools.py
"""__ModuleName__ tools.""" from typing import Type from langchain_core.callbacks import ( CallbackManagerForToolRun, ) from langchain_core.tools import BaseTool from pydantic import BaseModel, Field class __ModuleName__ToolInput(BaseModel): """Input schema for __ModuleName__ tool. This docstring is **...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/integration_template/integration_template/document_loaders.py
libs/cli/langchain_cli/integration_template/integration_template/document_loaders.py
"""__ModuleName__ document loader.""" from typing import Iterator from langchain_core.document_loaders.base import BaseLoader from langchain_core.documents import Document class __ModuleName__Loader(BaseLoader): # TODO: Replace all TODOs in docstring. See example docstring: # https://github.com/langchain-ai...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/integration_template/integration_template/vectorstores.py
libs/cli/langchain_cli/integration_template/integration_template/vectorstores.py
"""__ModuleName__ vector stores.""" from __future__ import annotations import uuid from typing import ( Any, Callable, Iterator, List, Sequence, Tuple, Type, TypeVar, ) from langchain_core.documents import Document from langchain_core.embeddings import Embeddings from langchain_core.v...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/integration_template/integration_template/retrievers.py
libs/cli/langchain_cli/integration_template/integration_template/retrievers.py
"""__ModuleName__ retrievers.""" from typing import Any, List from langchain_core.callbacks import CallbackManagerForRetrieverRun from langchain_core.documents import Document from langchain_core.retrievers import BaseRetriever class __ModuleName__Retriever(BaseRetriever): # TODO: Replace all TODOs in docstring...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/integration_template/integration_template/__init__.py
libs/cli/langchain_cli/integration_template/integration_template/__init__.py
from importlib import metadata from __module_name__.chat_models import Chat__ModuleName__ from __module_name__.document_loaders import __ModuleName__Loader from __module_name__.embeddings import __ModuleName__Embeddings from __module_name__.retrievers import __ModuleName__Retriever from __module_name__.toolkits import...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/integration_template/integration_template/embeddings.py
libs/cli/langchain_cli/integration_template/integration_template/embeddings.py
from typing import List from langchain_core.embeddings import Embeddings class __ModuleName__Embeddings(Embeddings): """__ModuleName__ embedding model integration. # TODO: Replace with relevant packages, env vars. Setup: Install `__package_name__` and set environment variable `__MODULE_N...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/integration_template/integration_template/toolkits.py
libs/cli/langchain_cli/integration_template/integration_template/toolkits.py
"""__ModuleName__ toolkits.""" from typing import List from langchain_core.tools import BaseTool, BaseToolkit class __ModuleName__Toolkit(BaseToolkit): # TODO: Replace all TODOs in docstring. See example docstring: # https://github.com/langchain-ai/langchain/blob/c123cb2b304f52ab65db4714eeec46af69a861ec/lib...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/integration_template/tests/__init__.py
libs/cli/langchain_cli/integration_template/tests/__init__.py
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/integration_template/tests/unit_tests/test_tools.py
libs/cli/langchain_cli/integration_template/tests/unit_tests/test_tools.py
from typing import Type from __module_name__.tools import __ModuleName__Tool from langchain_tests.unit_tests import ToolsUnitTests class TestParrotMultiplyToolUnit(ToolsUnitTests): @property def tool_constructor(self) -> Type[__ModuleName__Tool]: return __ModuleName__Tool @property def tool_...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/integration_template/tests/unit_tests/test_chat_models.py
libs/cli/langchain_cli/integration_template/tests/unit_tests/test_chat_models.py
"""Test chat model integration.""" from typing import Type from __module_name__.chat_models import Chat__ModuleName__ from langchain_tests.unit_tests import ChatModelUnitTests class TestChat__ModuleName__Unit(ChatModelUnitTests): @property def chat_model_class(self) -> Type[Chat__ModuleName__]: retu...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/integration_template/tests/unit_tests/__init__.py
libs/cli/langchain_cli/integration_template/tests/unit_tests/__init__.py
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/integration_template/tests/unit_tests/test_embeddings.py
libs/cli/langchain_cli/integration_template/tests/unit_tests/test_embeddings.py
"""Test embedding model integration.""" from typing import Type from __module_name__.embeddings import __ModuleName__Embeddings from langchain_tests.unit_tests import EmbeddingsUnitTests class TestParrotLinkEmbeddingsUnit(EmbeddingsUnitTests): @property def embeddings_class(self) -> Type[__ModuleName__Embed...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/integration_template/tests/integration_tests/test_tools.py
libs/cli/langchain_cli/integration_template/tests/integration_tests/test_tools.py
from typing import Type from __module_name__.tools import __ModuleName__Tool from langchain_tests.integration_tests import ToolsIntegrationTests class TestParrotMultiplyToolIntegration(ToolsIntegrationTests): @property def tool_constructor(self) -> Type[__ModuleName__Tool]: return __ModuleName__Tool ...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/integration_template/tests/integration_tests/test_vectorstores.py
libs/cli/langchain_cli/integration_template/tests/integration_tests/test_vectorstores.py
from typing import Generator import pytest from __module_name__.vectorstores import __ModuleName__VectorStore from langchain_core.vectorstores import VectorStore from langchain_tests.integration_tests import VectorStoreIntegrationTests class Test__ModuleName__VectorStore(VectorStoreIntegrationTests): @pytest.fix...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/integration_template/tests/integration_tests/test_compile.py
libs/cli/langchain_cli/integration_template/tests/integration_tests/test_compile.py
import pytest @pytest.mark.compile def test_placeholder() -> None: """Used for compiling integration tests without running any real tests.""" pass
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/integration_template/tests/integration_tests/test_chat_models.py
libs/cli/langchain_cli/integration_template/tests/integration_tests/test_chat_models.py
"""Test Chat__ModuleName__ chat model.""" from typing import Type from __module_name__.chat_models import Chat__ModuleName__ from langchain_tests.integration_tests import ChatModelIntegrationTests class TestChatParrotLinkIntegration(ChatModelIntegrationTests): @property def chat_model_class(self) -> Type[Ch...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/integration_template/tests/integration_tests/__init__.py
libs/cli/langchain_cli/integration_template/tests/integration_tests/__init__.py
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/integration_template/tests/integration_tests/test_retrievers.py
libs/cli/langchain_cli/integration_template/tests/integration_tests/test_retrievers.py
from typing import Type from __module_name__.retrievers import __ModuleName__Retriever from langchain_tests.integration_tests import ( RetrieversIntegrationTests, ) class Test__ModuleName__Retriever(RetrieversIntegrationTests): @property def retriever_constructor(self) -> Type[__ModuleName__Retriever]: ...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/integration_template/tests/integration_tests/test_embeddings.py
libs/cli/langchain_cli/integration_template/tests/integration_tests/test_embeddings.py
"""Test __ModuleName__ embeddings.""" from typing import Type from __module_name__.embeddings import __ModuleName__Embeddings from langchain_tests.integration_tests import EmbeddingsIntegrationTests class TestParrotLinkEmbeddingsIntegration(EmbeddingsIntegrationTests): @property def embeddings_class(self) -...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/utils/git.py
libs/cli/langchain_cli/utils/git.py
"""Git utilities.""" from __future__ import annotations import hashlib import logging import re import shutil from pathlib import Path from typing import TYPE_CHECKING, Any, TypedDict from git import Repo from langchain_cli.constants import ( DEFAULT_GIT_REF, DEFAULT_GIT_REPO, DEFAULT_GIT_SUBDIRECTORY, ...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/utils/find_replace.py
libs/cli/langchain_cli/utils/find_replace.py
"""Find and replace text in files.""" from pathlib import Path def find_and_replace(source: str, replacements: dict[str, str]) -> str: """Find and replace text in a string. Args: source: The source string. replacements: A dictionary of `{find: replace}` pairs. Returns: The modif...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/utils/events.py
libs/cli/langchain_cli/utils/events.py
"""Events utilities.""" from __future__ import annotations import http.client import json from typing import Any, TypedDict import typer WRITE_KEY = "310apTK0HUFl4AOv" class EventDict(TypedDict): """Event data structure for analytics tracking. Attributes: event: The name of the event. pro...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/utils/pyproject.py
libs/cli/langchain_cli/utils/pyproject.py
"""Pyproject.toml utilities.""" import contextlib from collections.abc import Iterable from pathlib import Path from typing import Any from tomlkit import dump, inline_table, load from tomlkit.items import InlineTable def _get_dep_inline_table(path: Path) -> InlineTable: dep = inline_table() dep.update({"pa...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/utils/__init__.py
libs/cli/langchain_cli/utils/__init__.py
"""Utilities."""
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/utils/github.py
libs/cli/langchain_cli/utils/github.py
"""GitHub utilities.""" from __future__ import annotations import http.client import json def list_packages(*, contains: str | None = None) -> list[str]: """List all packages in the langchain repository templates directory. Args: contains: Optional substring that the package name must contain. ...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/utils/packages.py
libs/cli/langchain_cli/utils/packages.py
"""Packages utilities.""" from __future__ import annotations from pathlib import Path from typing import Any, TypedDict, cast from tomlkit import load def get_package_root(cwd: Path | None = None) -> Path: """Get package root directory. Args: cwd: The current working directory to start the search ...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/namespaces/integration.py
libs/cli/langchain_cli/namespaces/integration.py
"""Develop integration packages for LangChain.""" import os import re import shutil import subprocess from pathlib import Path from typing import Annotated, cast import typer from typing_extensions import TypedDict from langchain_cli.utils.find_replace import replace_file, replace_glob integration_cli = typer.Typer...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/namespaces/template.py
libs/cli/langchain_cli/namespaces/template.py
"""Develop installable templates.""" import re import shutil import subprocess from pathlib import Path from typing import Annotated import typer import uvicorn from langchain_cli.utils.github import list_packages from langchain_cli.utils.packages import get_langserve_export, get_package_root package_cli = typer.Ty...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/namespaces/__init__.py
libs/cli/langchain_cli/namespaces/__init__.py
"""Namespaces."""
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/namespaces/app.py
libs/cli/langchain_cli/namespaces/app.py
"""Manage LangChain apps.""" import shutil import subprocess import sys import warnings from pathlib import Path from typing import Annotated import typer import uvicorn from langchain_cli.utils.events import create_events from langchain_cli.utils.git import ( DependencySource, copy_repo, parse_dependenc...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/namespaces/migrate/main.py
libs/cli/langchain_cli/namespaces/migrate/main.py
"""Migrate LangChain to the most recent version.""" from pathlib import Path import rich import typer from gritql import run # type: ignore[import-untyped] from typer import Option def get_gritdir_path() -> Path: """Get the path to the grit directory.""" script_dir = Path(__file__).parent return script...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/namespaces/migrate/__init__.py
libs/cli/langchain_cli/namespaces/migrate/__init__.py
"""Migrations."""
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/namespaces/migrate/generate/partner.py
libs/cli/langchain_cli/namespaces/migrate/generate/partner.py
"""Generate migrations for partner packages.""" import importlib from langchain_core.documents import BaseDocumentCompressor, BaseDocumentTransformer from langchain_core.embeddings import Embeddings from langchain_core.language_models import BaseLanguageModel from langchain_core.retrievers import BaseRetriever from l...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/namespaces/migrate/generate/grit.py
libs/cli/langchain_cli/namespaces/migrate/generate/grit.py
"""Migration as Grit file.""" def split_package(package: str) -> tuple[str, str]: """Split a package name into the containing package and the final name. Args: package: The full package name. Returns: A tuple of `(containing_package, final_name)`. """ parts = package.split(".") ...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/namespaces/migrate/generate/utils.py
libs/cli/langchain_cli/namespaces/migrate/generate/utils.py
"""Generate migrations utilities.""" import ast import inspect import os import pathlib from pathlib import Path from types import ModuleType from typing_extensions import override HERE = Path(__file__).parent # Should bring us to [root]/src PKGS_ROOT = HERE.parent.parent.parent.parent.parent LANGCHAIN_PKG = PKGS_R...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/namespaces/migrate/generate/generic.py
libs/cli/langchain_cli/namespaces/migrate/generate/generic.py
"""Generate migrations from langchain to langchain-community or core packages.""" import importlib import inspect import pkgutil from types import ModuleType def generate_raw_migrations( from_package: str, to_package: str, filter_by_all: bool = False, # noqa: FBT001, FBT002 ) -> list[tuple[str, str]]: ...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/namespaces/migrate/generate/__init__.py
libs/cli/langchain_cli/namespaces/migrate/generate/__init__.py
"""Generate migrations."""
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/package_template/tests/__init__.py
libs/cli/langchain_cli/package_template/tests/__init__.py
"""Tests."""
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/package_template/package_template/chain.py
libs/cli/langchain_cli/package_template/package_template/chain.py
"""Chain definition.""" from langchain_core.prompts import ChatPromptTemplate from langchain_openai import ChatOpenAI _prompt = ChatPromptTemplate.from_messages( [ ( "system", "You are a helpful assistant who speaks like a pirate", ), ("human", "{text}"), ] ) _m...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/package_template/package_template/__init__.py
libs/cli/langchain_cli/package_template/package_template/__init__.py
"""__module_name__ module.""" from __module_name__.chain import chain __all__ = ["chain"]
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/project_template/app/__init__.py
libs/cli/langchain_cli/project_template/app/__init__.py
"""Server application."""
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
langchain-ai/langchain
https://github.com/langchain-ai/langchain/blob/e5d4acf681784d1ea356c932cf31c1c9723dbafa/libs/cli/langchain_cli/project_template/app/server.py
libs/cli/langchain_cli/project_template/app/server.py
"""Chain server.""" from fastapi import FastAPI from fastapi.responses import RedirectResponse from langserve import add_routes app = FastAPI() @app.get("/") async def _redirect_root_to_docs() -> RedirectResponse: return RedirectResponse("/docs") # Edit this to add the chain you want to add add_routes(app, No...
python
MIT
e5d4acf681784d1ea356c932cf31c1c9723dbafa
2026-01-04T14:38:15.444279Z
false
exo-explore/exo
https://github.com/exo-explore/exo/blob/17f9b583a48def54c99d35a5815a4fdc3e81f090/.github/scripts/build_matrix.py
.github/scripts/build_matrix.py
#!/usr/bin/env python3 import json import os from typing import NotRequired, TypedDict, cast import yaml class MatrixEntry(TypedDict): label: str index: int class MatrixInclude(TypedDict): label: str index: int is_primary: bool expected_nodes: int class Config(TypedDict): hardware_pla...
python
Apache-2.0
17f9b583a48def54c99d35a5815a4fdc3e81f090
2026-01-04T14:40:59.780748Z
false
exo-explore/exo
https://github.com/exo-explore/exo/blob/17f9b583a48def54c99d35a5815a4fdc3e81f090/.github/scripts/bench.py
.github/scripts/bench.py
#!/usr/bin/env python3 # type: ignore """ Unified benchmark script for EXO. Runs single or multi-stage benchmarks with configurable load patterns. Requests are fire-and-forget, allowing overlapping execution. Simple benchmark (1 iteration): --config .github/configs/bench_simple.yaml Complex benchmark (multiple sta...
python
Apache-2.0
17f9b583a48def54c99d35a5815a4fdc3e81f090
2026-01-04T14:40:59.780748Z
true
exo-explore/exo
https://github.com/exo-explore/exo/blob/17f9b583a48def54c99d35a5815a4fdc3e81f090/tmp/run_llm.py
tmp/run_llm.py
#!/usr/bin/env python3 import argparse import json import sys import requests def stream_chat(host: str, query: str) -> None: url = f"http://{host}:52415/v1/chat/completions" headers = {"Content-Type": "application/json"} payload = { "model": "mlx-community/Llama-3.2-1B-Instruct-4bit", # ...
python
Apache-2.0
17f9b583a48def54c99d35a5815a4fdc3e81f090
2026-01-04T14:40:59.780748Z
false
exo-explore/exo
https://github.com/exo-explore/exo/blob/17f9b583a48def54c99d35a5815a4fdc3e81f090/src/exo/__main__.py
src/exo/__main__.py
from __future__ import annotations import sys from collections.abc import Sequence from multiprocessing import freeze_support from typing import Final from exo.main import main INLINE_CODE_FLAG: Final[str] = "-c" def _maybe_run_inline_code(argv: Sequence[str]) -> bool: """ Reproduce the bare minimum of Pyt...
python
Apache-2.0
17f9b583a48def54c99d35a5815a4fdc3e81f090
2026-01-04T14:40:59.780748Z
false
exo-explore/exo
https://github.com/exo-explore/exo/blob/17f9b583a48def54c99d35a5815a4fdc3e81f090/src/exo/main.py
src/exo/main.py
import argparse import multiprocessing as mp import os import signal from dataclasses import dataclass, field from typing import Self import anyio from anyio.abc import TaskGroup from loguru import logger from pydantic import PositiveInt import exo.routing.topics as topics from exo.master.api import API # TODO: shou...
python
Apache-2.0
17f9b583a48def54c99d35a5815a4fdc3e81f090
2026-01-04T14:40:59.780748Z
false
exo-explore/exo
https://github.com/exo-explore/exo/blob/17f9b583a48def54c99d35a5815a4fdc3e81f090/src/exo/__init__.py
src/exo/__init__.py
python
Apache-2.0
17f9b583a48def54c99d35a5815a4fdc3e81f090
2026-01-04T14:40:59.780748Z
false
exo-explore/exo
https://github.com/exo-explore/exo/blob/17f9b583a48def54c99d35a5815a4fdc3e81f090/src/exo/worker/plan.py
src/exo/worker/plan.py
# pyright: reportUnusedImport = false from collections.abc import Mapping, Sequence from exo.shared.types.common import NodeId from exo.shared.types.models import ModelId from exo.shared.types.tasks import ( ChatCompletion, ConnectToGroup, CreateRunner, DownloadModel, LoadModel, Shutdown, ...
python
Apache-2.0
17f9b583a48def54c99d35a5815a4fdc3e81f090
2026-01-04T14:40:59.780748Z
false
exo-explore/exo
https://github.com/exo-explore/exo/blob/17f9b583a48def54c99d35a5815a4fdc3e81f090/src/exo/worker/main.py
src/exo/worker/main.py
from datetime import datetime, timezone from random import random import anyio from anyio import CancelScope, create_task_group, current_time, fail_after from anyio.abc import TaskGroup from loguru import logger from exo.routing.connection_message import ConnectionMessage, ConnectionMessageType from exo.shared.apply ...
python
Apache-2.0
17f9b583a48def54c99d35a5815a4fdc3e81f090
2026-01-04T14:40:59.780748Z
false
exo-explore/exo
https://github.com/exo-explore/exo/blob/17f9b583a48def54c99d35a5815a4fdc3e81f090/src/exo/worker/__init__.py
src/exo/worker/__init__.py
python
Apache-2.0
17f9b583a48def54c99d35a5815a4fdc3e81f090
2026-01-04T14:40:59.780748Z
false
exo-explore/exo
https://github.com/exo-explore/exo/blob/17f9b583a48def54c99d35a5815a4fdc3e81f090/src/exo/worker/tests/constants.py
src/exo/worker/tests/constants.py
from typing import Final from exo.shared.types.common import CommandId, NodeId from exo.shared.types.models import ModelId from exo.shared.types.tasks import TaskId from exo.shared.types.worker.instances import InstanceId, RunnerId MASTER_NODE_ID = NodeId("ffffffff-aaaa-4aaa-8aaa-aaaaaaaaaaaa") NODE_A: Final[NodeId]...
python
Apache-2.0
17f9b583a48def54c99d35a5815a4fdc3e81f090
2026-01-04T14:40:59.780748Z
false
exo-explore/exo
https://github.com/exo-explore/exo/blob/17f9b583a48def54c99d35a5815a4fdc3e81f090/src/exo/worker/tests/__init__.py
src/exo/worker/tests/__init__.py
python
Apache-2.0
17f9b583a48def54c99d35a5815a4fdc3e81f090
2026-01-04T14:40:59.780748Z
false
exo-explore/exo
https://github.com/exo-explore/exo/blob/17f9b583a48def54c99d35a5815a4fdc3e81f090/src/exo/worker/tests/unittests/conftest.py
src/exo/worker/tests/unittests/conftest.py
from dataclasses import dataclass, field from exo.shared.types.common import NodeId from exo.shared.types.memory import Memory from exo.shared.types.models import ModelId, ModelMetadata from exo.shared.types.tasks import BaseTask, TaskId from exo.shared.types.worker.instances import ( BoundInstance, Instance, ...
python
Apache-2.0
17f9b583a48def54c99d35a5815a4fdc3e81f090
2026-01-04T14:40:59.780748Z
false
exo-explore/exo
https://github.com/exo-explore/exo/blob/17f9b583a48def54c99d35a5815a4fdc3e81f090/src/exo/worker/tests/unittests/__init__.py
src/exo/worker/tests/unittests/__init__.py
python
Apache-2.0
17f9b583a48def54c99d35a5815a4fdc3e81f090
2026-01-04T14:40:59.780748Z
false
exo-explore/exo
https://github.com/exo-explore/exo/blob/17f9b583a48def54c99d35a5815a4fdc3e81f090/src/exo/worker/tests/unittests/test_mlx/__init__.py
src/exo/worker/tests/unittests/test_mlx/__init__.py
python
Apache-2.0
17f9b583a48def54c99d35a5815a4fdc3e81f090
2026-01-04T14:40:59.780748Z
false
exo-explore/exo
https://github.com/exo-explore/exo/blob/17f9b583a48def54c99d35a5815a4fdc3e81f090/src/exo/worker/tests/unittests/test_plan/test_runner_lifecycle.py
src/exo/worker/tests/unittests/test_plan/test_runner_lifecycle.py
from typing import Any import exo.worker.plan as plan_mod from exo.shared.types.tasks import Shutdown from exo.shared.types.worker.instances import BoundInstance, Instance, InstanceId from exo.shared.types.worker.runners import ( RunnerFailed, RunnerId, RunnerReady, RunnerStatus, ) from exo.worker.test...
python
Apache-2.0
17f9b583a48def54c99d35a5815a4fdc3e81f090
2026-01-04T14:40:59.780748Z
false
exo-explore/exo
https://github.com/exo-explore/exo/blob/17f9b583a48def54c99d35a5815a4fdc3e81f090/src/exo/worker/tests/unittests/test_plan/test_download_and_loading.py
src/exo/worker/tests/unittests/test_plan/test_download_and_loading.py
import exo.worker.plan as plan_mod from exo.shared.types.common import NodeId from exo.shared.types.models import ModelId from exo.shared.types.tasks import LoadModel from exo.shared.types.worker.downloads import DownloadCompleted, DownloadProgress from exo.shared.types.worker.instances import BoundInstance from exo.sh...
python
Apache-2.0
17f9b583a48def54c99d35a5815a4fdc3e81f090
2026-01-04T14:40:59.780748Z
false
exo-explore/exo
https://github.com/exo-explore/exo/blob/17f9b583a48def54c99d35a5815a4fdc3e81f090/src/exo/worker/tests/unittests/test_plan/test_warmup.py
src/exo/worker/tests/unittests/test_plan/test_warmup.py
import exo.worker.plan as plan_mod from exo.shared.types.tasks import StartWarmup from exo.shared.types.worker.instances import BoundInstance from exo.shared.types.worker.runners import ( RunnerIdle, RunnerLoaded, RunnerLoading, RunnerWarmingUp, ) from exo.worker.tests.constants import ( INSTANCE_1_...
python
Apache-2.0
17f9b583a48def54c99d35a5815a4fdc3e81f090
2026-01-04T14:40:59.780748Z
false
exo-explore/exo
https://github.com/exo-explore/exo/blob/17f9b583a48def54c99d35a5815a4fdc3e81f090/src/exo/worker/tests/unittests/test_plan/__init__.py
src/exo/worker/tests/unittests/test_plan/__init__.py
python
Apache-2.0
17f9b583a48def54c99d35a5815a4fdc3e81f090
2026-01-04T14:40:59.780748Z
false
exo-explore/exo
https://github.com/exo-explore/exo/blob/17f9b583a48def54c99d35a5815a4fdc3e81f090/src/exo/worker/tests/unittests/test_plan/test_task_forwarding.py
src/exo/worker/tests/unittests/test_plan/test_task_forwarding.py
from typing import cast import exo.worker.plan as plan_mod from exo.shared.types.api import ChatCompletionTaskParams from exo.shared.types.tasks import ChatCompletion, Task, TaskId, TaskStatus from exo.shared.types.worker.instances import BoundInstance, InstanceId from exo.shared.types.worker.runners import ( Runn...
python
Apache-2.0
17f9b583a48def54c99d35a5815a4fdc3e81f090
2026-01-04T14:40:59.780748Z
false
exo-explore/exo
https://github.com/exo-explore/exo/blob/17f9b583a48def54c99d35a5815a4fdc3e81f090/src/exo/worker/tests/unittests/test_runner/test_runner_supervisor.py
src/exo/worker/tests/unittests/test_runner/test_runner_supervisor.py
# TODO:
python
Apache-2.0
17f9b583a48def54c99d35a5815a4fdc3e81f090
2026-01-04T14:40:59.780748Z
false
exo-explore/exo
https://github.com/exo-explore/exo/blob/17f9b583a48def54c99d35a5815a4fdc3e81f090/src/exo/worker/tests/unittests/test_runner/__init__.py
src/exo/worker/tests/unittests/test_runner/__init__.py
python
Apache-2.0
17f9b583a48def54c99d35a5815a4fdc3e81f090
2026-01-04T14:40:59.780748Z
false
exo-explore/exo
https://github.com/exo-explore/exo/blob/17f9b583a48def54c99d35a5815a4fdc3e81f090/src/exo/worker/tests/unittests/test_runner/test_event_ordering.py
src/exo/worker/tests/unittests/test_runner/test_event_ordering.py
# Check tasks are complete before runner is ever ready. from collections.abc import Iterable from typing import Callable import pytest import exo.worker.runner.runner as mlx_runner from exo.shared.types.api import ChatCompletionMessage from exo.shared.types.chunks import TokenChunk from exo.shared.types.events import...
python
Apache-2.0
17f9b583a48def54c99d35a5815a4fdc3e81f090
2026-01-04T14:40:59.780748Z
false
exo-explore/exo
https://github.com/exo-explore/exo/blob/17f9b583a48def54c99d35a5815a4fdc3e81f090/src/exo/worker/tests/unittests/test_download/__init__.py
src/exo/worker/tests/unittests/test_download/__init__.py
python
Apache-2.0
17f9b583a48def54c99d35a5815a4fdc3e81f090
2026-01-04T14:40:59.780748Z
false
exo-explore/exo
https://github.com/exo-explore/exo/blob/17f9b583a48def54c99d35a5815a4fdc3e81f090/src/exo/worker/utils/net_profile.py
src/exo/worker/utils/net_profile.py
import http.client from anyio import create_task_group, to_thread from loguru import logger from exo.shared.topology import Topology from exo.shared.types.common import NodeId async def check_reachability( target_ip: str, expected_node_id: NodeId, self_node_id: NodeId, out: dict[NodeId, set[str]], )...
python
Apache-2.0
17f9b583a48def54c99d35a5815a4fdc3e81f090
2026-01-04T14:40:59.780748Z
false
exo-explore/exo
https://github.com/exo-explore/exo/blob/17f9b583a48def54c99d35a5815a4fdc3e81f090/src/exo/worker/utils/system_info.py
src/exo/worker/utils/system_info.py
import socket import sys from subprocess import CalledProcessError import psutil from anyio import run_process from exo.shared.types.profiling import NetworkInterfaceInfo async def get_friendly_name() -> str: """ Asynchronously gets the 'Computer Name' (friendly name) of a Mac. e.g., "John's MacBook Pro...
python
Apache-2.0
17f9b583a48def54c99d35a5815a4fdc3e81f090
2026-01-04T14:40:59.780748Z
false
exo-explore/exo
https://github.com/exo-explore/exo/blob/17f9b583a48def54c99d35a5815a4fdc3e81f090/src/exo/worker/utils/profile.py
src/exo/worker/utils/profile.py
import asyncio import os import platform from typing import Any, Callable, Coroutine import anyio from loguru import logger from exo.shared.types.memory import Memory from exo.shared.types.profiling import ( MemoryPerformanceProfile, NodePerformanceProfile, SystemPerformanceProfile, ) from .macmon import...
python
Apache-2.0
17f9b583a48def54c99d35a5815a4fdc3e81f090
2026-01-04T14:40:59.780748Z
false
exo-explore/exo
https://github.com/exo-explore/exo/blob/17f9b583a48def54c99d35a5815a4fdc3e81f090/src/exo/worker/utils/macmon.py
src/exo/worker/utils/macmon.py
import platform import shutil from subprocess import CalledProcessError from typing import cast from anyio import run_process from pydantic import BaseModel, ConfigDict, ValidationError class MacMonError(Exception): """Exception raised for errors in the MacMon functions.""" def _get_binary_path() -> str: "...
python
Apache-2.0
17f9b583a48def54c99d35a5815a4fdc3e81f090
2026-01-04T14:40:59.780748Z
false
exo-explore/exo
https://github.com/exo-explore/exo/blob/17f9b583a48def54c99d35a5815a4fdc3e81f090/src/exo/worker/utils/__init__.py
src/exo/worker/utils/__init__.py
from .profile import start_polling_memory_metrics, start_polling_node_metrics __all__ = [ "start_polling_node_metrics", "start_polling_memory_metrics", ]
python
Apache-2.0
17f9b583a48def54c99d35a5815a4fdc3e81f090
2026-01-04T14:40:59.780748Z
false
exo-explore/exo
https://github.com/exo-explore/exo/blob/17f9b583a48def54c99d35a5815a4fdc3e81f090/src/exo/worker/utils/tests/__init__.py
src/exo/worker/utils/tests/__init__.py
python
Apache-2.0
17f9b583a48def54c99d35a5815a4fdc3e81f090
2026-01-04T14:40:59.780748Z
false
exo-explore/exo
https://github.com/exo-explore/exo/blob/17f9b583a48def54c99d35a5815a4fdc3e81f090/src/exo/worker/utils/tests/test_macmon.py
src/exo/worker/utils/tests/test_macmon.py
"""Tests for macmon error handling. These tests verify that MacMon errors are handled gracefully without crashing the application or spamming logs. """ import platform from subprocess import CalledProcessError from unittest.mock import AsyncMock, patch import pytest from exo.worker.utils.macmon import MacMonError, ...
python
Apache-2.0
17f9b583a48def54c99d35a5815a4fdc3e81f090
2026-01-04T14:40:59.780748Z
false
exo-explore/exo
https://github.com/exo-explore/exo/blob/17f9b583a48def54c99d35a5815a4fdc3e81f090/src/exo/worker/runner/runner.py
src/exo/worker/runner/runner.py
import time from exo.shared.types.api import ChatCompletionMessageText from exo.shared.types.chunks import TokenChunk from exo.shared.types.events import ( ChunkGenerated, Event, RunnerStatusUpdated, TaskAcknowledged, TaskStatusUpdated, ) from exo.shared.types.tasks import ( ChatCompletion, ...
python
Apache-2.0
17f9b583a48def54c99d35a5815a4fdc3e81f090
2026-01-04T14:40:59.780748Z
false
exo-explore/exo
https://github.com/exo-explore/exo/blob/17f9b583a48def54c99d35a5815a4fdc3e81f090/src/exo/worker/runner/runner_supervisor.py
src/exo/worker/runner/runner_supervisor.py
import contextlib import signal from dataclasses import dataclass, field from multiprocessing import Process from typing import Self import anyio from anyio import ( BrokenResourceError, ClosedResourceError, create_task_group, to_thread, ) from anyio.abc import TaskGroup from loguru import logger from...
python
Apache-2.0
17f9b583a48def54c99d35a5815a4fdc3e81f090
2026-01-04T14:40:59.780748Z
false
exo-explore/exo
https://github.com/exo-explore/exo/blob/17f9b583a48def54c99d35a5815a4fdc3e81f090/src/exo/worker/runner/bootstrap.py
src/exo/worker/runner/bootstrap.py
import os import loguru from exo.shared.types.events import Event, RunnerStatusUpdated from exo.shared.types.tasks import Task from exo.shared.types.worker.instances import BoundInstance, MlxJacclInstance from exo.shared.types.worker.runners import RunnerFailed from exo.utils.channels import MpReceiver, MpSender log...
python
Apache-2.0
17f9b583a48def54c99d35a5815a4fdc3e81f090
2026-01-04T14:40:59.780748Z
false
exo-explore/exo
https://github.com/exo-explore/exo/blob/17f9b583a48def54c99d35a5815a4fdc3e81f090/src/exo/worker/engines/__init__.py
src/exo/worker/engines/__init__.py
python
Apache-2.0
17f9b583a48def54c99d35a5815a4fdc3e81f090
2026-01-04T14:40:59.780748Z
false
exo-explore/exo
https://github.com/exo-explore/exo/blob/17f9b583a48def54c99d35a5815a4fdc3e81f090/src/exo/worker/engines/mlx/utils_mlx.py
src/exo/worker/engines/mlx/utils_mlx.py
import json import os import resource import time from pathlib import Path from typing import Any, Callable, cast from mlx_lm.models.cache import KVCache, QuantizedKVCache, RotatingKVCache from mlx_lm.models.deepseek_v3 import DeepseekV3Model from mlx_lm.sample_utils import make_sampler from mlx_lm.tokenizer_utils imp...
python
Apache-2.0
17f9b583a48def54c99d35a5815a4fdc3e81f090
2026-01-04T14:40:59.780748Z
false
exo-explore/exo
https://github.com/exo-explore/exo/blob/17f9b583a48def54c99d35a5815a4fdc3e81f090/src/exo/worker/engines/mlx/constants.py
src/exo/worker/engines/mlx/constants.py
# TODO: Do we want so many constants? # I think we want a lot of these as parameters? KV_GROUP_SIZE: int | None = 32 KV_BITS: int | None = None ATTENTION_KV_BITS: int | None = 4 MAX_TOKENS: int = 8192 MAX_KV_SIZE: int | None = 3200 KEEP_KV_SIZE: int | None = 1600 QUANTIZE_MODEL_MODE: str | None = "affine" CACHE_GROUP...
python
Apache-2.0
17f9b583a48def54c99d35a5815a4fdc3e81f090
2026-01-04T14:40:59.780748Z
false