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
  0063b450_c21c_b257_9b29_feae30b816b4["_model_params()"]
  70048a7c_06ac_54dc_f2cc_70cbfa8bcbc9["_ConfigurableModel"]
  0063b450_c21c_b257_9b29_feae30b816b4 -->|defined in| 70048a7c_06ac_54dc_f2cc_70cbfa8bcbc9
  1ec96341_0cad_d4df_0b5f_401dfd4ccd5a["_model()"]
  1ec96341_0cad_d4df_0b5f_401dfd4ccd5a -->|calls| 0063b450_c21c_b257_9b29_feae30b816b4
  b32190e9_dc8d_06e8_042b_1bf06cc182ad["with_config()"]
  b32190e9_dc8d_06e8_042b_1bf06cc182ad -->|calls| 0063b450_c21c_b257_9b29_feae30b816b4
  style 0063b450_c21c_b257_9b29_feae30b816b4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/chat_models/base.py lines 707–718

    def _model_params(self, config: RunnableConfig | None) -> dict:
        config = ensure_config(config)
        model_params = {
            k.removeprefix(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/langchain_classic/chat_models/base.py.
Where is _model_params() defined?
_model_params() is defined in libs/langchain/langchain_classic/chat_models/base.py at line 707.
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