Work with models
Use models when you need to llm authentication, provider routing, and tier management.
Prerequisites
- Access to the project source code
- Familiarity with the files under src/attune/models/**
Steps
-
Understand the current behavior. Read the entry points to see what models does today before making changes. The primary functions are:
cmd_auth_setup()insrc/attune/models/auth_cli.py— Run interactive authentication strategy setup.cmd_auth_status()insrc/attune/models/auth_cli.py— Show current authentication strategy configuration.cmd_auth_reset()insrc/attune/models/auth_cli.py— Reset/clear authentication strategy configuration.cmd_auth_recommend()insrc/attune/models/auth_cli.py— Get authentication recommendation for a specific file.main()insrc/attune/models/auth_cli.py— Main CLI entry point.
-
Locate the right function to change. Each function has a single responsibility. Read its docstring, parameters, and return type to confirm it owns the behavior you need to modify.
-
Make your change. Follow existing patterns in the file — naming conventions, error handling style, and logging.
-
Run the related tests. This catches regressions before they reach other developers. Target with
pytest -k "models".
Key files
src/attune/models/**
Common modifications
Functions you are most likely to modify:
cmd_auth_setup()insrc/attune/models/auth_cli.pycmd_auth_status()insrc/attune/models/auth_cli.pycmd_auth_reset()insrc/attune/models/auth_cli.pycmd_auth_recommend()insrc/attune/models/auth_cli.pymain()insrc/attune/models/auth_cli.pyconfigure_auth_interactive()insrc/attune/models/auth_strategy.pyget_auth_strategy()insrc/attune/models/auth_strategy.pycount_lines_of_code()insrc/attune/models/auth_strategy.py