You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Lee-W (via GitHub)" <gi...@apache.org> on 2026/08/23 22:33:12 UTC
[PR] Fix LlamaIndexHook docs to stop claiming Ollama/vLLM support [airflow]
Lee-W opened a new pull request, #72013:
URL: https://github.com/apache/airflow/pull/72013
The class docstring, the host field description, and the UI placeholder said host= could point LlamaIndexHook at Ollama or vLLM. get_llm() and get_embedding_model() return LlamaIndex's OpenAI / OpenAIEmbedding classes, which validate model= client-side against LlamaIndex's OpenAI-only model-name allowlists before any request is sent, so an Ollama/vLLM model name is rejected regardless of host. Document the real constraint and why it exists instead of the non-existent Ollama/vLLM support.
<!-- SPDX-License-Identifier: Apache-2.0
https://www.apache.org/licenses/LICENSE-2.0 -->
<!--
Thank you for contributing!
Please provide above a brief description of the changes made in this pull request.
Write a good git commit message following this guide: https://chris.beams.io/posts/git-commit/
Please make sure that your code changes are covered with tests.
And in case of new features or big changes remember to adjust the documentation.
For user-facing UI changes, please attach before/after screenshots (or a short
screen recording) so reviewers can assess the visual impact.
Feel free to ping (in general) for the review if you do not see reaction for a few days
(72 Hours is the minimum reaction time you can expect from volunteers) - we sometimes miss notifications.
In case of an existing issue, reference it using one of the following:
* closes: #ISSUE
* related: #ISSUE
-->
---
##### Was generative AI tooling used to co-author this PR?
<!--
If generative AI tooling has been used in the process of authoring this PR, please
change below checkbox to `[X]` followed by the name of the tool, uncomment the "Generated-by".
-->
- [x] Yes (please specify the tool below)
Generated-by: [Tool Name] following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
---
* Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)** for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
* For fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed.
* When adding dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
* For significant user-facing changes create newsfragment: `{pr_number}.significant.rst`, in [airflow-core/newsfragments](https://github.com/apache/airflow/tree/main/airflow-core/newsfragments). You can add this file in a follow-up commit after the PR is created so you know the PR number.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix LlamaIndexHook docs to stop claiming Ollama/vLLM support [airflow]
Posted by "uros-b (via GitHub)" <gi...@apache.org>.
uros-b commented on PR #72013:
URL: https://github.com/apache/airflow/pull/72013#issuecomment-5392555235
+1, LGTM!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix LlamaIndexHook docs to stop claiming Ollama/vLLM support [airflow]
Posted by "ColtenOuO (via GitHub)" <gi...@apache.org>.
ColtenOuO commented on code in PR #72013:
URL: https://github.com/apache/airflow/pull/72013#discussion_r3842599924
##########
providers/common/ai/src/airflow/providers/common/ai/hooks/llamaindex.py:
##########
@@ -58,11 +58,27 @@ class LlamaIndexHook(BaseHook):
to LlamaIndex constructors so concurrent tasks in the same worker
don't race on shared state.
+ .. note::
+
+ ``get_llm()`` and ``get_embedding_model()`` return LlamaIndex's
+ ``OpenAI`` / ``OpenAIEmbedding`` classes, which validate ``model=``
+ client-side against LlamaIndex's OpenAI-only model-name allowlists
+ before any request is sent. Pointing **host** at an Ollama or vLLM
+ endpoint does not add support for those backends: their model names
+ (e.g. ``llama3.2``) are never in the OpenAI allowlist, so the call
+ still fails on the model name, not on connectivity.
+ ``get_embedding_model()`` raises immediately at construction;
+ ``get_llm()`` defers the error until the first call that reads
+ ``.metadata`` (``.chat()`` / ``.complete()``).
+
Connection fields:
* **password**: API key passed as ``api_key=``.
- * **host**: Optional base URL passed as ``api_base=`` (custom endpoints,
- Ollama, vLLM).
+ * **host**: Optional base URL passed as ``api_base=``. Only useful for
+ an OpenAI-compatible proxy that accepts OpenAI's exact model names
+ (e.g. an internal gateway or Azure OpenAI-compatible endpoint) -- not
Review Comment:
ditto
##########
providers/common/ai/docs/hooks/llamaindex.rst:
##########
@@ -73,8 +83,10 @@ The hook reads credentials from the Airflow connection of type ``llamaindex``:
- **password** -- API key (passed as ``api_key`` to ``OpenAIEmbedding`` /
``OpenAI``).
-- **host** -- Optional base URL (passed as ``api_base``; useful for custom
- OpenAI-compatible endpoints, Ollama, vLLM).
+- **host** -- Optional base URL (passed as ``api_base``). Only useful for
+ an OpenAI-compatible proxy that accepts OpenAI's exact model names (e.g.
+ an internal gateway or Azure OpenAI-compatible endpoint) -- not Ollama
Review Comment:
Azure OpenAI addresses models by custom deployment names rather than OpenAI's canonical model names, so it doesn't really fit the "accepts OpenAI's exact model names" rule here.
Maybe just drop the Azure example and keep the internal gateway one?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix LlamaIndexHook docs to stop claiming Ollama/vLLM support [airflow]
Posted by "gopidesupavan (via GitHub)" <gi...@apache.org>.
gopidesupavan merged PR #72013:
URL: https://github.com/apache/airflow/pull/72013
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix LlamaIndexHook docs to stop claiming Ollama/vLLM support [airflow]
Posted by "Lee-W (via GitHub)" <gi...@apache.org>.
Lee-W commented on code in PR #72013:
URL: https://github.com/apache/airflow/pull/72013#discussion_r3872718231
##########
providers/common/ai/docs/hooks/llamaindex.rst:
##########
@@ -73,8 +83,10 @@ The hook reads credentials from the Airflow connection of type ``llamaindex``:
- **password** -- API key (passed as ``api_key`` to ``OpenAIEmbedding`` /
``OpenAI``).
-- **host** -- Optional base URL (passed as ``api_base``; useful for custom
- OpenAI-compatible endpoints, Ollama, vLLM).
+- **host** -- Optional base URL (passed as ``api_base``). Only useful for
+ an OpenAI-compatible proxy that accepts OpenAI's exact model names (e.g.
+ an internal gateway or Azure OpenAI-compatible endpoint) -- not Ollama
Review Comment:
Dropped the Azure example; the `host` bullet now keeps only the internal-gateway one and says Ollama and vLLM are not covered.
##########
providers/common/ai/src/airflow/providers/common/ai/hooks/llamaindex.py:
##########
@@ -58,11 +58,27 @@ class LlamaIndexHook(BaseHook):
to LlamaIndex constructors so concurrent tasks in the same worker
don't race on shared state.
+ .. note::
+
+ ``get_llm()`` and ``get_embedding_model()`` return LlamaIndex's
+ ``OpenAI`` / ``OpenAIEmbedding`` classes, which validate ``model=``
+ client-side against LlamaIndex's OpenAI-only model-name allowlists
+ before any request is sent. Pointing **host** at an Ollama or vLLM
+ endpoint does not add support for those backends: their model names
+ (e.g. ``llama3.2``) are never in the OpenAI allowlist, so the call
+ still fails on the model name, not on connectivity.
+ ``get_embedding_model()`` raises immediately at construction;
+ ``get_llm()`` defers the error until the first call that reads
+ ``.metadata`` (``.chat()`` / ``.complete()``).
+
Connection fields:
* **password**: API key passed as ``api_key=``.
- * **host**: Optional base URL passed as ``api_base=`` (custom endpoints,
- Ollama, vLLM).
+ * **host**: Optional base URL passed as ``api_base=``. Only useful for
+ an OpenAI-compatible proxy that accepts OpenAI's exact model names
+ (e.g. an internal gateway or Azure OpenAI-compatible endpoint) -- not
Review Comment:
Same change applied to the docstring.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix LlamaIndexHook docs to stop claiming Ollama/vLLM support [airflow]
Posted by "Lee-W (via GitHub)" <gi...@apache.org>.
Lee-W commented on PR #72013:
URL: https://github.com/apache/airflow/pull/72013#issuecomment-5440654021
`external-services` on the `llamaindex` entry is now `OpenAI` only, the `host` placeholder no longer names Ollama, and `get_provider_info.py` is regenerated.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org