Skip to content

Commit af6221c

Browse files
authored
Merge pull request #12 from tanevanwifferen/master
Allow to override model choice from bash
2 parents 154f141 + 06d223d commit af6221c

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

README.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,6 @@ To use in bash scripts, add the --no-intermediates, so it doesn't print intermed
106106
$ llm --no-intermediates "What is the time in Tokyo right now?"
107107
```
108108

109-
```bash
110-
$ llm --no-confirmations "What is the top article on hackernews today?"
111-
```
112-
113109
### Continuation
114110

115111
Add a `c ` prefix to your message to continue the last conversation.
@@ -171,6 +167,7 @@ $ llm --no-tools # Run without any tools
171167
$ llm --force-refresh # Force refresh tool capabilities cache
172168
$ llm --text-only # Output raw text without markdown formatting
173169
$ llm --show-memories # Show user memories
170+
$ llm --model gpt-4 # Override the model specified in config
174171
```
175172
176173
## Setup

src/mcp_client_cli/cli.py

+6
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ def setup_argument_parser() -> argparse.Namespace:
105105
help='Only print the final message')
106106
parser.add_argument('--show-memories', action='store_true',
107107
help='Show user memories')
108+
parser.add_argument('--model',
109+
help='Override the model specified in config')
108110
return parser.parse_args()
109111

110112
async def handle_list_tools(app_config: AppConfig, args: argparse.Namespace) -> None:
@@ -201,6 +203,10 @@ async def handle_conversation(args: argparse.Namespace, query: HumanMessage,
201203
extra_body = {}
202204
if app_config.llm.base_url and "openrouter" in app_config.llm.base_url:
203205
extra_body = {"transforms": ["middle-out"]}
206+
# Override model if specified in command line
207+
if args.model:
208+
app_config.llm.model = args.model
209+
204210
model: BaseChatModel = init_chat_model(
205211
model=app_config.llm.model,
206212
model_provider=app_config.llm.provider,

0 commit comments

Comments
 (0)