@@ -15,10 +15,10 @@ especially useful when you're working on multiple projects or tasks that require
15
15
different AI models.
16
16
17
17
In each of your CodeGate workspaces, you can select the AI provider and model
18
- combinations to use, even dynamically switching the active model based on file
19
- types found in your prompt. Then, configure your AI coding tool to use the
20
- CodeGate muxing endpoint ` http://localhost:8989/v1/mux ` as an OpenAI-compatible
21
- API provider.
18
+ combinations to use, even dynamically switching the active model based on the
19
+ request type and file types found in your prompt. Then, configure your AI coding
20
+ tool to use the CodeGate muxing endpoint ` http://localhost:8989/v1/mux ` as an
21
+ OpenAI-compatible API provider.
22
22
23
23
To change the model(s) currently in use, simply switch your active CodeGate
24
24
workspace.
@@ -38,9 +38,11 @@ flowchart LR
38
38
CodeGate --> WS1
39
39
CodeGate --> WS2
40
40
CodeGate --> WS3
41
- WS1 --> |api| LLM1
42
- WS2 --> |api| LLM2
43
- WS3 --> |api| LLM3
41
+ WS1 --> |FIM requests| LLM1
42
+ WS1 --> |Chat| LLM2
43
+ WS2 --> |.md files| LLM2
44
+ WS2 --> |.js files| LLM3
45
+ WS3 --> |All prompts| LLM3
44
46
```
45
47
46
48
## Use cases
@@ -109,21 +111,33 @@ workspace selection menu or the
109
111
In the ** Model Muxing** section, select the default ("catch-all") model to use
110
112
with the workspace.
111
113
112
- To assign a different model based on filename, click ** Add Filter** . In the
113
- ** Filter by** column, enter a file name or extension string to match. This is a
114
- simple substring match, wildcards are not supported. For example, to match
115
- Python files, enter ` .py ` . Then select the model to use with that file type.
114
+ To assign a different model based on request type or filename, click ** Add
115
+ Filter** .
116
+
117
+ In the ** Request Type** column, select the type of prompt to match:
118
+
119
+ - ` FIM & Chat ` matches all prompt types
120
+ - ` FIM ` matches fill-in-the-middle (completion) requests
121
+ - ` Chat ` matches chat prompts
122
+
123
+ In the ** Filter by** column, enter a file name or extension string to match.
124
+ This is an exact or ` endswith ` match, wildcards are not supported. For example,
125
+ to match Python files, enter ` .py ` .
126
+
127
+ Finally, select the model to use for prompts that match the rule.
116
128
117
129
Filter rules are evaluated top-down. CodeGate selects the active model for a
118
130
request using the first matching rule. If the prompt contains multiple files in
119
131
context, the first rule that matches _ any_ of the files is used. If no filter is
120
132
matched, the catch-all rule applies.
121
133
134
+ #### Example configuration
135
+
122
136
<ThemedImage
123
137
alt = ' An example showing several muxing rules for different file types'
124
138
sources = { {
125
139
light: useBaseUrl (' /img/features/muxing-rules-light.webp' ),
126
- dark: useBaseUrl (' /img/quickstart /muxing-rules-dark.webp' ),
140
+ dark: useBaseUrl (' /img/features /muxing-rules-dark.webp' ),
127
141
}}
128
142
title = ' Example muxing rules'
129
143
width = { ' 800px' }
@@ -132,10 +146,13 @@ _An example showing several muxing rules for different file types_
132
146
133
147
Breaking down the above example:
134
148
135
- - Markdown files (` .md ` ) use the gpt-4o-mini model from the OpenAI provider.
136
- - JavaScript and TypeScript files (` .js ` and ` .ts ` , which also matches ` .jsx `
137
- and ` .tsx ` ) use anthropic/claude-3.5-sonnet via OpenRouter.
138
- - All other requests use Ollama.
149
+ - Markdown files (` .md ` ) use the gpt-4o-mini model from the OpenAI provider for
150
+ all request types.
151
+ - Chat prompts for JavaScript files (` .js ` , but NOT ` .jsx ` ) use
152
+ anthropic/claude-3.7-sonnet via OpenRouter.
153
+ - FIM requests for all files (except ` .md ` since it's higher in the list) use
154
+ Ollama with the qwen2.5-coder:1.5b model.
155
+ - All other requests use anthropic/claude-3.5-sonnet via OpenRouter.
139
156
- A request containing both a JavaScript and Markdown file will match the ` .md `
140
157
rule first and use OpenAI.
141
158
0 commit comments