Home / Function/ _model_params() — langchain Function Reference

_model_params() — langchain Function Reference

Architecture documentation for the _model_params() function in base.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  0b90fa9e_f078_8f67_ae9e_cb118bf2fe05["_model_params()"]
  74f697e6_2555_becc_640e_6f41ea707eba["_ConfigurableModel"]
  0b90fa9e_f078_8f67_ae9e_cb118bf2fe05 -->|defined in| 74f697e6_2555_becc_640e_6f41ea707eba
  4d79fd76_22aa_8160_64a3_c62bd0bfe875["_model()"]
  4d79fd76_22aa_8160_64a3_c62bd0bfe875 -->|calls| 0b90fa9e_f078_8f67_ae9e_cb118bf2fe05
  514cf019_f432_1f30_3f62_e457a97002ae["with_config()"]
  514cf019_f432_1f30_3f62_e457a97002ae -->|calls| 0b90fa9e_f078_8f67_ae9e_cb118bf2fe05
  206c801c_28be_c9dd_94bf_bab6c4e3ca55["_remove_prefix()"]
  0b90fa9e_f078_8f67_ae9e_cb118bf2fe05 -->|calls| 206c801c_28be_c9dd_94bf_bab6c4e3ca55
  style 0b90fa9e_f078_8f67_ae9e_cb118bf2fe05 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain_v1/langchain/chat_models/base.py lines 657–666

    def _model_params(self, config: RunnableConfig | None) -> dict[str, Any]:
        config = ensure_config(config)
        model_params = {
            _remove_prefix(k, self._config_prefix): v
            for k, v in config.get("configurable", {}).items()
            if k.startswith(self._config_prefix)
        }
        if self._configurable_fields != "any":
            model_params = {k: v for k, v in model_params.items() if k in self._configurable_fields}
        return model_params

Domain

Subdomains

Frequently Asked Questions

What does _model_params() do?
_model_params() is a function in the langchain codebase, defined in libs/langchain_v1/langchain/chat_models/base.py.
Where is _model_params() defined?
_model_params() is defined in libs/langchain_v1/langchain/chat_models/base.py at line 657.
What does _model_params() call?
_model_params() calls 1 function(s): _remove_prefix.
What calls _model_params()?
_model_params() is called by 2 function(s): _model, with_config.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free