From 52ab8ab0e114e0ffa349e7a66274362e9ea39f57 Mon Sep 17 00:00:00 2001 From: Piotr Duda Date: Wed, 21 Oct 2026 12:57:47 +0200 Subject: [PATCH] Name llama.cpp integration after its runtime and simplify README --- .github/workflows/compat.yml | 2 +- CHANGELOG.md | 5 ++ README.md | 49 ++++++------------- docs/compatibility.md | 8 +-- docs/deployment.md | 16 ++++++ examples/django_gemma/demo.sh | 6 +-- examples/django_gemma/gemmaapp/views.py | 2 +- examples/gguf_example.py | 4 +- scripts/compat_matrix.py | 4 +- tests/compat/fixtures/README.md | 4 +- ...guf_compat.py => test_llama_cpp_compat.py} | 2 +- tests/test_cli.py | 10 ++++ tests/test_integration_patching.py | 23 ++++++++- wildedge/cli.py | 16 ++++-- wildedge/client.py | 6 ++- wildedge/integrations/gguf.py | 2 +- wildedge/integrations/registry.py | 18 +++++-- wildedge/settings.py | 9 +++- 18 files changed, 125 insertions(+), 61 deletions(-) rename tests/compat/{test_gguf_compat.py => test_llama_cpp_compat.py} (98%) diff --git a/.github/workflows/compat.yml b/.github/workflows/compat.yml index 1e71865..46ef03d 100644 --- a/.github/workflows/compat.yml +++ b/.github/workflows/compat.yml @@ -71,7 +71,7 @@ jobs: --version-set "${{ matrix.version-set }}" \ --python-version "${{ matrix.python-version }}" - name: Cache downloaded test models - if: matrix.integration == 'gguf' || matrix.integration == 'faster_whisper' + if: matrix.integration == 'llama_cpp' || matrix.integration == 'faster_whisper' uses: actions/cache@v4 with: path: | diff --git a/CHANGELOG.md b/CHANGELOG.md index 72014a6..780819a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ under Unreleased and move into a version section at release time. ### Changed +- The llama.cpp Python integration is now named `llama_cpp` in Python, CLI, + and environment configuration. `gguf` remains a compatibility alias; `all` + selects the integration once under its new name. Model format metadata + remains `gguf`. + - Automatic integrations no longer attach raw payloads, including GGUF prompts, chat messages and replies. `attachments_enabled=True` enables uploads only for attachments explicitly passed to `track_inference(attachments=[...])`. diff --git a/README.md b/README.md index bf3528e..193fab2 100644 --- a/README.md +++ b/README.md @@ -12,9 +12,14 @@ [![PyPI](https://img.shields.io/pypi/v/wildedge-sdk)](https://pypi.org/project/wildedge-sdk/) [![Coverage](https://codecov.io/gh/wild-edge/wildedge-python/branch/main/graph/badge.svg)](https://codecov.io/gh/wild-edge/wildedge-python) -ML inference monitoring for Python: on-device and remote models. Tracks latency, tokens, errors, and model metadata with no code changes, plus traces for agent pipelines. +Monitor local and remote ML inference from Python. Track latency, token usage, +errors, model metadata, and local hardware context across llama.cpp, MLX, +Transformers, OpenAI, and more. -**[Get a DSN](https://app.wildedge.dev)** · [Website](https://wildedge.dev) · [Docs](https://docs.wildedge.dev) · [Blog](https://blog.wildedge.dev) +Instrument supported libraries with one command, or add tracking in your code. +Prompts and outputs aren't uploaded unless you explicitly attach them. + +**[Get started](#install)** · [Docs](https://docs.wildedge.dev) · [Website](https://wildedge.dev) ## Install @@ -26,32 +31,19 @@ To send events, sign up at [app.wildedge.dev](https://app.wildedge.dev), create ## CLI -Drop `wildedge run` in front of your existing command. WildEdge instruments the runtime before your code starts. No SDK calls required in user code. +Monitor an existing application by adding `wildedge run` to its start command: ```bash WILDEDGE_DSN="https://@ingest.wildedge.dev/" \ -wildedge run --integrations timm -- python app.py -``` - -Validate your environment before deploying. `--send-test-event` proves the -whole pipeline end to end by sending one span event and reporting the ingest -response (exit codes: 0 pass, 1 config failure, 2 connectivity failure): - -```bash -wildedge doctor --integrations all --send-test-event +wildedge run --integrations llama_cpp -- python app.py ``` -Useful flags: +The `llama_cpp` integration instruments llama.cpp through `llama-cpp-python`. +Replace it with your [integration](#supported-integrations). +No SDK calls are required in your application code. -| Flag | Description | -|---|---| -| `--integrations` | Comma-separated list of integrations to activate (or `all`) | -| `--hubs` | Hub trackers to activate: `huggingface`, `torchhub` | -| `--print-startup-report` | Print per-integration status at startup | -| `--strict-integrations` | Exit (code 121) if a requested integration can't be instrumented | -| `--strict` | Exit (120 config, 122 internal) instead of running untracked when bootstrap fails | -| `--attachments` | Enable opt-in raw input/output attachment upload | -| `--no-propagate` | Don't pass WildEdge env vars to child processes | +See the [deployment guide](docs/deployment.md) for startup options, +environment validation, and production configuration. ## SDK @@ -91,7 +83,7 @@ for client lifecycle and the full contract. | `mlx_whisper` / `faster_whisper` | [whisper_example.py](https://github.com/wild-edge/wildedge-python/blob/main/examples/whisper_example.py) | | `mlx` | [mlx_example.py](https://github.com/wild-edge/wildedge-python/blob/main/examples/mlx_example.py) | | `timm` | [timm_example.py](https://github.com/wild-edge/wildedge-python/blob/main/examples/timm_example.py) | -| `gguf` | [gguf_example.py](https://github.com/wild-edge/wildedge-python/blob/main/examples/gguf_example.py) | +| llama.cpp (`llama_cpp`, via `llama-cpp-python`) | [gguf_example.py](https://github.com/wild-edge/wildedge-python/blob/main/examples/gguf_example.py) | | `onnx` | [onnx_example.py](https://github.com/wild-edge/wildedge-python/blob/main/examples/onnx_example.py) | | `ultralytics` | - | | `tensorflow` | [tensorflow_example.py](https://github.com/wild-edge/wildedge-python/blob/main/examples/tensorflow_example.py) | @@ -148,17 +140,6 @@ For unsupported frameworks, see [Manual tracking](https://github.com/wild-edge/w For advanced options (batching, queue tuning, dead-letter storage, attachments), see [Configuration](https://github.com/wild-edge/wildedge-python/blob/main/docs/configuration.md). -## Projects using this SDK - -| Name | Link | -|---|---| -| outfitstudio.app | https://outfitstudio.app/ | -| agntr | [github.com/pmaciolek/agntr](https://github.com/pmaciolek/agntr) | -| demo-app | [github.com/wild-edge/demo-app](https://github.com/wild-edge/demo-app) | -| *(your project here)* | - | - -Using WildEdge in your project? Open a PR to add it to the list. - ## Security & Privacy By default the SDK transmits only anonymized telemetry, never raw model inputs diff --git a/docs/compatibility.md b/docs/compatibility.md index aab6547..0c08065 100644 --- a/docs/compatibility.md +++ b/docs/compatibility.md @@ -9,12 +9,12 @@ generated from `scripts/compat_matrix.py`, which also defines the CI jobs. `tests/compat/test__compat.py` loads a real model with the real library and checks the events the SDK records: a `model_load` event, then an `inference` event for the same model with the expected fields (token counts -for LLMs, input modality for vision models). Apart from one download for gguf, nothing +for LLMs, input modality for vision models). Apart from one download for llama_cpp, nothing touches the network: - openai and anthropic get canned responses through the SDK's own HTTP client (`MockTransport`). -- onnx loads a tiny model committed in `tests/compat/fixtures`. gguf +- onnx loads a tiny model committed in `tests/compat/fixtures`. llama_cpp downloads a 1.2 MB model on first use, checked against a pinned sha256. - torch, timm, tensorflow, transformers, ultralytics and mlx build models from a config, with random weights. @@ -57,8 +57,8 @@ To run the full matrix locally: `python scripts/run_compat_local.py`. | `tensorflow` | `min` | `tensorflow==2.16.1`, `keras==3.3.3`, `numpy==1.26.4` | 3.10, 3.11, 3.12 | | `tensorflow` | `current` | `tensorflow==2.21.0`, `keras==3.15.1`, `numpy==2.2.6` | 3.10, 3.11, 3.12 | | `tensorflow` | `current` (`py3.10` override) | `tensorflow==2.21.0`, `keras==3.12.4`, `numpy==2.2.6` | 3.10 | -| `gguf` | `min` | `llama-cpp-python==0.2.90`, `numpy==1.26.4` | 3.10, 3.11, 3.12, 3.13 | -| `gguf` | `current` | `llama-cpp-python==0.3.36`, `numpy==2.2.6` | 3.10, 3.11, 3.12, 3.13 | +| `llama_cpp` | `min` | `llama-cpp-python==0.2.90`, `numpy==1.26.4` | 3.10, 3.11, 3.12, 3.13 | +| `llama_cpp` | `current` | `llama-cpp-python==0.3.36`, `numpy==2.2.6` | 3.10, 3.11, 3.12, 3.13 | | `openai` | `min` | `openai==1.30.0` | 3.10, 3.11, 3.12, 3.13 | | `openai` | `current` | `openai==3.35.1` | 3.10, 3.11, 3.12, 3.13 | | `transformers` | `min` | `transformers==4.40.0`, `torch==2.4.1`, `numpy==1.26.4` | 3.10, 3.11, 3.12, 3.13 | diff --git a/docs/deployment.md b/docs/deployment.md index 48727fa..40829c6 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -35,6 +35,22 @@ Under `wildedge run`, a missing DSN warns on stderr and your program runs untracked. Telemetry failing must not take production down; that is the default policy. +## CLI options + +| Flag | Description | +|---|---| +| `--integrations` | Comma-separated runtime integrations, such as `llama_cpp`, `onnx`, or `openai`; default: `all` | +| `--hubs` | Download tracking via `huggingface` or `torchhub` | +| `--print-startup-report` | Print activation status for each integration | +| `--strict-integrations` | Exit with 121 if a requested integration cannot be instrumented | +| `--strict` | Exit on bootstrap failure; see the exit codes below | +| `--attachments` | Enable upload of explicitly supplied attachments | +| `--no-propagate` | Scrub run-scoped environment variables after initialization | + +Use `llama_cpp` for the `llama-cpp-python` runtime. The older name `gguf` is +accepted as a compatibility alias in Python, CLI, and environment settings. +The recorded model format remains `gguf`. + ## Strict mode `wildedge run --strict` inverts the failure policy for deployments where diff --git a/examples/django_gemma/demo.sh b/examples/django_gemma/demo.sh index 78d9ba1..9914f6b 100755 --- a/examples/django_gemma/demo.sh +++ b/examples/django_gemma/demo.sh @@ -11,7 +11,7 @@ cd "${SCRIPT_DIR}" uv sync -uv run wildedge doctor --integrations gguf --hubs huggingface +uv run wildedge doctor --integrations llama_cpp --hubs huggingface # wildedge run replaces this process (os.execle) so sitecustomize.py # auto-installs the runtime before Django loads, patching Llama.__init__ @@ -26,13 +26,13 @@ uv run wildedge doctor --integrations gguf --hubs huggingface if [[ "$(uname)" == "Darwin" ]]; then uv run wildedge run \ --print-startup-report \ - --integrations gguf \ + --integrations llama_cpp \ --hubs huggingface \ -- waitress-serve --port=8100 gemmaapp.wsgi:application else uv run wildedge run \ --print-startup-report \ - --integrations gguf \ + --integrations llama_cpp \ --hubs huggingface \ -- gunicorn gemmaapp.wsgi:application --config gunicorn.conf.py fi diff --git a/examples/django_gemma/gemmaapp/views.py b/examples/django_gemma/gemmaapp/views.py index 2bc3cf2..ebad98e 100644 --- a/examples/django_gemma/gemmaapp/views.py +++ b/examples/django_gemma/gemmaapp/views.py @@ -1,6 +1,6 @@ """Gemma inference view. -The Llama constructor is patched automatically by `wildedge run --integrations gguf` +The Llama constructor is patched automatically by `wildedge run --integrations llama_cpp` via sitecustomize.py; load/unload/inference events are tracked without any wildedge imports here. diff --git a/examples/gguf_example.py b/examples/gguf_example.py index ae8983e..4f252b6 100644 --- a/examples/gguf_example.py +++ b/examples/gguf_example.py @@ -7,7 +7,7 @@ # /// """GGUF / llama.cpp integration example. Run with: uv run gguf_example.py -The gguf integration tracks every llama-cpp-python entry point, once per +The llama_cpp integration tracks every llama-cpp-python entry point, once per call: create_chat_completion (streamed or not), create_completion and llm(...). Each inference event carries token counts, tokens per second, the stop reason and the sampling settings; chat calls also record @@ -21,7 +21,7 @@ wildedge.init( app_version="1.0.0", # uses WILDEDGE_DSN if set; otherwise no-op - integrations="gguf", + integrations="llama_cpp", hubs=["huggingface"], ) diff --git a/scripts/compat_matrix.py b/scripts/compat_matrix.py index f0cd352..038ab7b 100644 --- a/scripts/compat_matrix.py +++ b/scripts/compat_matrix.py @@ -39,7 +39,7 @@ "min": ["tensorflow==2.16.1", "keras==3.3.3", "numpy==1.26.4"], "current": ["tensorflow==2.21.0", "keras==3.15.1", "numpy==2.2.6"], }, - "gguf": { + "llama_cpp": { "min": ["llama-cpp-python==0.2.90", "numpy==1.26.4"], "current": ["llama-cpp-python==0.3.36", "numpy==2.2.6"], }, @@ -70,7 +70,7 @@ "torch": ["3.10", "3.11", "3.12", "3.13", "3.14"], "timm": ["3.10", "3.11", "3.12", "3.13", "3.14"], "tensorflow": ["3.10", "3.11", "3.12"], - "gguf": ["3.10", "3.11", "3.12", "3.13"], + "llama_cpp": ["3.10", "3.11", "3.12", "3.13"], "openai": ["3.10", "3.11", "3.12", "3.13"], "transformers": ["3.10", "3.11", "3.12", "3.13"], "ultralytics": ["3.10", "3.11", "3.12", "3.13"], diff --git a/tests/compat/fixtures/README.md b/tests/compat/fixtures/README.md index 3b3c7e4..91be61c 100644 --- a/tests/compat/fixtures/README.md +++ b/tests/compat/fixtures/README.md @@ -5,5 +5,5 @@ Larger models are downloaded on first use and checked against a sha256 (see `downloaded_fixture` in `../conftest.py`). They are cached in `tests/compat/.cache`, or in `$WILDEDGE_COMPAT_CACHE` when set, which CI -keeps between runs. The gguf test declares its model's URL and checksum at -the top of `test_gguf_compat.py`. +keeps between runs. The llama_cpp test declares its model's URL and checksum at +the top of `test_llama_cpp_compat.py`. diff --git a/tests/compat/test_gguf_compat.py b/tests/compat/test_llama_cpp_compat.py similarity index 98% rename from tests/compat/test_gguf_compat.py rename to tests/compat/test_llama_cpp_compat.py index 0d628cc..51cdd63 100644 --- a/tests/compat/test_gguf_compat.py +++ b/tests/compat/test_llama_cpp_compat.py @@ -16,7 +16,7 @@ @pytest.fixture def llm(compat_client): model = downloaded_fixture("stories260K-f32.gguf", MODEL_URL, MODEL_SHA256) - compat_client.instrument("gguf") + compat_client.instrument("llama_cpp") return llama_cpp.Llama(model_path=str(model), n_ctx=128, seed=1, verbose=False) diff --git a/tests/test_cli.py b/tests/test_cli.py index 882bf3b..9162a56 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -11,6 +11,7 @@ from wildedge.integrations.registry import IntegrationSpec from wildedge.platforms.device_info import DeviceInfo from wildedge.runtime import bootstrap +from wildedge.settings import parse_integration_list from wildedge.transmitter import IngestResponse, TransmitError @@ -578,3 +579,12 @@ def test_doctor_json_includes_environment_and_statuses(monkeypatch, capsys): assert data["environment"]["autoload_on_pythonpath"] is False assert data["config_status"] == "PASS" assert data["connectivity_status"] == "SKIP" + + +@pytest.mark.parametrize("names", ["gguf", "llama_cpp", "gguf,llama_cpp"]) +def test_llama_cpp_names_resolve_once_in_cli_and_environment(names): + assert cli.integration_list(names) == ["llama_cpp"] + assert parse_integration_list(names, []) == ["llama_cpp"] + assert cli.INTEGRATIONS_BY_NAME["gguf"] is cli.INTEGRATIONS_BY_NAME["llama_cpp"] + assert "llama_cpp" in cli.integration_list("all") + assert "gguf" not in cli.integration_list("all") diff --git a/tests/test_integration_patching.py b/tests/test_integration_patching.py index 479a5df..9482e29 100644 --- a/tests/test_integration_patching.py +++ b/tests/test_integration_patching.py @@ -217,7 +217,7 @@ def test_instrument_hubs_activates_requested_trackers(stub_client): activated = [] with ( patch.object(stub_client, "_activate_hub", side_effect=activated.append), - patch.dict(stub_client.PATCH_INSTALLERS, {"gguf": lambda ref: None}), + patch.dict(stub_client.PATCH_INSTALLERS, {"llama_cpp": lambda ref: None}), ): stub_client.instrument("gguf", hubs=["huggingface"]) @@ -244,3 +244,24 @@ def test_instrument_none_activates_hub(stub_client): with patch.object(stub_client, "_activate_hub", side_effect=activated.append): stub_client.instrument(None, hubs=["huggingface"]) assert activated == ["huggingface"] + + +@pytest.mark.parametrize("names", [("gguf", "llama_cpp"), ("llama_cpp", "gguf")]) +def test_llama_cpp_aliases_share_patch_and_client_route( + stub_client, monkeypatch, names +): + class FakeLlama: + def __init__(self, *args, **kwargs): + pass + + runtime = types.SimpleNamespace(Llama=FakeLlama) + monkeypatch.setattr(gguf_mod, "_llama_cpp", runtime) + monkeypatch.setattr(gguf_mod, "_llama_patched", False) + stub_client.instrument(names[0]) + first = runtime.Llama.__init__ + stub_client.instrument(names[1]) + assert runtime.Llama.__init__ is first + with patch.object(stub_client, "_on_model_auto_loaded") as loaded: + model = runtime.Llama("model.gguf") + loaded.assert_called_once() + assert loaded.call_args.args[0] is model diff --git a/wildedge/cli.py b/wildedge/cli.py index 2199335..5b6e11a 100644 --- a/wildedge/cli.py +++ b/wildedge/cli.py @@ -21,7 +21,11 @@ from wildedge.client import parse_dsn from wildedge.events.span import SpanEvent from wildedge.hubs.registry import HUBS_BY_NAME, supported_hubs -from wildedge.integrations.registry import INTEGRATIONS_BY_NAME, supported_integrations +from wildedge.integrations.registry import ( + INTEGRATIONS_BY_NAME, + canonical_integration, + supported_integrations, +) from wildedge.paths import default_dead_letter_dir, default_pending_queue_dir from wildedge.platforms import detect_device, get_device_id_path from wildedge.settings import read_client_env, resolve_app_identity @@ -44,7 +48,7 @@ def build_parser() -> argparse.ArgumentParser: run.add_argument( "--integrations", default="all", - help="Comma-separated framework integrations to enable (gguf, onnx, timm, …). Default: all.", + help="Comma-separated framework integrations to enable (llama_cpp, onnx, timm, …). Default: all.", ) run.add_argument( "--hubs", @@ -291,7 +295,13 @@ def run_command(parsed: argparse.Namespace) -> int: def integration_list(value: str | None) -> list[str]: if not value or value == "all": return sorted(supported_integrations()) - return [item.strip() for item in value.split(",") if item.strip()] + return list( + dict.fromkeys( + canonical_integration(item.strip()) + for item in value.split(",") + if item.strip() + ) + ) def hub_list(value: str | None) -> list[str]: diff --git a/wildedge/client.py b/wildedge/client.py index e755e4f..c0a0f8d 100644 --- a/wildedge/client.py +++ b/wildedge/client.py @@ -27,6 +27,7 @@ from wildedge.integrations.base import BaseExtractor from wildedge.integrations.registry import ( INTEGRATION_SPECS, + canonical_integration, find_extractor, noop_integrations, supported_integrations, @@ -739,7 +740,7 @@ def instrument( Pass ``hubs=`` alongside a framework name to activate download provenance tracking for the hub(s) your code downloads from:: - client.instrument("gguf", hubs=["huggingface"]) + client.instrument("llama_cpp", hubs=["huggingface"]) client.instrument("onnx", hubs=["huggingface"]) client.instrument("timm", hubs=["huggingface", "torchhub"]) @@ -753,7 +754,7 @@ def instrument( Supported framework integrations --------------------------------- - ``"gguf"`` + ``"llama_cpp"`` (``"gguf"`` remains a compatibility alias) Patches ``llama_cpp.Llama.__init__``. Requires ``llama-cpp-python``. ``"onnx"`` Replaces ``ort.InferenceSession`` with a timed subclass. @@ -816,6 +817,7 @@ def instrument( self._activate_hub(hub_name) return + integration = canonical_integration(integration) if integration in self.SUPPORTED_HUBS: raise ValueError( f"{integration!r} is a hub, not a framework integration. " diff --git a/wildedge/integrations/gguf.py b/wildedge/integrations/gguf.py index a9959ef..2f54d6d 100644 --- a/wildedge/integrations/gguf.py +++ b/wildedge/integrations/gguf.py @@ -54,7 +54,7 @@ LLAMA_AUTO_LOAD_PATCH_NAME = "gguf_auto_load" -debug_gguf_failure = functools.partial(debug_failure, "gguf") +debug_gguf_failure = functools.partial(debug_failure, "llama_cpp") def n_gpu_layers(obj: object) -> int: diff --git a/wildedge/integrations/registry.py b/wildedge/integrations/registry.py index 8e892c6..94fc78c 100644 --- a/wildedge/integrations/registry.py +++ b/wildedge/integrations/registry.py @@ -33,17 +33,18 @@ class IntegrationSpec: name: str required_modules: tuple[str, ...] kind: IntegrationKind + adapter_module: str | None = None @property def installer(self) -> str | None: if self.kind != "client_patch": return None - return f"{ADAPTER_PACKAGE}.{self.name}:install_auto_load_patch" + return f"{ADAPTER_PACKAGE}.{self.adapter_module or self.name}:install_auto_load_patch" INTEGRATION_SPECS: tuple[IntegrationSpec, ...] = ( IntegrationSpec("anthropic", ("anthropic",), "client_patch"), - IntegrationSpec("gguf", ("llama_cpp",), "client_patch"), + IntegrationSpec("llama_cpp", ("llama_cpp",), "client_patch", adapter_module="gguf"), IntegrationSpec("onnx", ("onnxruntime",), "client_patch"), IntegrationSpec("openai", ("openai",), "client_patch"), IntegrationSpec("timm", ("timm",), "client_patch"), @@ -62,9 +63,20 @@ def installer(self) -> str | None: } +# Public names describe runtimes; retain the pre-0.3 name as an input alias. +INTEGRATION_ALIASES = {"gguf": "llama_cpp"} +INTEGRATIONS_BY_NAME.update( + {alias: INTEGRATIONS_BY_NAME[name] for alias, name in INTEGRATION_ALIASES.items()} +) + + +def canonical_integration(name: str) -> str: + return INTEGRATION_ALIASES.get(name, name) + + def supported_integrations() -> set[str]: """Return all supported integration names.""" - return set(INTEGRATIONS_BY_NAME.keys()) + return {spec.name for spec in INTEGRATION_SPECS} def noop_integrations() -> set[str]: diff --git a/wildedge/settings.py b/wildedge/settings.py index 6c445b8..855e9e1 100644 --- a/wildedge/settings.py +++ b/wildedge/settings.py @@ -5,6 +5,7 @@ from dataclasses import dataclass from wildedge import constants +from wildedge.integrations.registry import canonical_integration TRUE_VALUES = {"1", "true", "yes", "on"} @@ -46,7 +47,13 @@ def parse_integration_list(value: str | None, all_values: list[str]) -> list[str """Parse ``--integrations`` value; defaults to all when unset.""" if not value or value == "all": return sorted(all_values) - return [item.strip() for item in value.split(",") if item.strip()] + return list( + dict.fromkeys( + canonical_integration(item.strip()) + for item in value.split(",") + if item.strip() + ) + ) def parse_hub_list(value: str | None, all_values: list[str]) -> list[str]: