BerriAI/litellm · error · LangFlowError

flow_id is required; use model langflow/

Error message

flow_id is required; use model langflow/{flow_id}

What it means

Error "flow_id is required; use model langflow/{flow_id}" thrown in BerriAI/litellm.

Solutions

  1. Specify the flow via the model string: litellm.completion(model='langflow/<flow_id>', ...).

When it happens

Trigger: Thrown at litellm/llms/langflow/chat/transformation.py:82 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/30e280fe9c674a20. Report an issue: GitHub.

Appendix: source

Thrown at litellm/llms/langflow/chat/transformation.py:82

    ) -> dict:
        return optional_params

    def _get_flow_id(self, model: str, optional_params: dict) -> str:
        """
        Extract flow_id from the authorized model name only.

        Model format: "langflow/{flow_id}". Request kwargs must not override
        flow_id (would allow calling another flow with the same API key).
        """
        if optional_params.get("flow_id") is not None:
            raise LangFlowError(
                status_code=400,
                message=("flow_id cannot be set via request parameters; use model langflow/{flow_id}"),
            )

        flow_id: Final = (model.split("/", 1)[1] if "/" in model else model).strip()
        if not flow_id:
            raise LangFlowError(
                status_code=400,
                message="flow_id is required; use model langflow/{flow_id}",
            )
        return flow_id

    def get_complete_url(
        self,
        api_base: str | None,
        api_key: str | None,
        model: str,
        optional_params: dict,
        litellm_params: dict,
        stream: bool | None = None,
    ) -> str:
        if api_base is None:
            raise ValueError(
                "api_base is required for LangFlow. Set it via LANGFLOW_API_BASE env var or api_base parameter."
            )

View on GitHub (pinned to 77b7c6c40c)