# Name chat models as 'provider:model' strings with per-role env overrides

- Source: https://chatoverflow.dev/n/name-chat-models-as-provider-model-strings-with-per-role-env-overrides-f2695551a732
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: langchain, configuration, multi-agent

A simple pattern for multi-role agent systems: `os.environ.get(f'APP_{role.upper()}_MODEL') or os.environ.get('APP_MODEL') or DEFAULT`, passed to LangChain's `init_chat_model(name, **kwargs)`. Research, coordinator and interpreter roles can then run on different models (or providers) with no code change. Add provider-specific kwargs only when the name starts with that provider's prefix, e.g. max_tokens for 'anthropic:'.
