Custom LLMs
Junie CLI supports custom models defined via JSON profiles. This feature allows you to integrate with local providers (e.g., Ollama), enterprise proxies, or any LLM endpoint that follows the supported API formats.
Configuration
Location and discovery
By default, custom models are discovered from JSON files located in:
User-scope:
$JUNIE_HOME/models/*.json.Project-scope:
.junie/models/*.json.
The filename (without the .json extension) is used as the profile identifier.
You can control where Junie searches for custom models using the following command-line options:
Option | Default | Description |
|---|---|---|
|
| Enable or disable adding custom models from default locations (per user / per project). |
| — | Additional folders where custom models should be found. Can be specified multiple times. |
You can also set these values in the config.json file. For details, see Junie CLI configuration files.
Profile structure
A custom model profile consists of a top-level configuration and two optional model roles:
Top-level properties: Serve as the default configuration (base URL, API key, API type, and extra headers) for the models in the profile.
primaryModel: The model used for main reasoning and code generation tasks.fasterModel: The model used for internal helper tasks like summarizing context or classifying tasks.
If primaryModel or fasterModel is not explicitly defined, they inherit the top-level properties.
Top-level parameters
These parameters appear at the root of the JSON profile and define the defaults shared by both model roles.
Parameter | Type | Required | Description |
|---|---|---|---|
| String | Yes | The model identifier as expected by the API endpoint (for example, |
| String | Yes | The full URL of the LLM API endpoint (for example, |
| String | Yes | The API format to use when communicating with the endpoint. See Supported API types for the list of accepted values. |
| String | No | The API key for authenticating with the endpoint. If omitted, requests are sent without an |
| Object | No | A key-value map of additional HTTP headers to include in every request to the endpoint. |
| Number | No | The sampling temperature to use for requests. If omitted, the provider's default temperature is used. See Temperature. |
| Object | No | Role-specific overrides for the primary model. See Role-specific parameters. |
| Object | No | Role-specific overrides for the faster model. See Role-specific parameters. |
Role-specific parameters
primaryModel and fasterModel accept the same set of parameters. Any parameter specified here overrides the corresponding top-level value for that model role. Omitted parameters fall back to the top-level defaults.
Parameter | Type | Description |
|---|---|---|
| String | Override for the model identifier used for this role. |
| String | Override for the API endpoint URL used for this role. |
| String | Override for the API format used for this role. |
| String | Override for the API key used for this role. |
| Object | Additional headers for this role. Merged with (not replaced by) the top-level |
| Number | Override for the sampling temperature used for this role. |
Merging logic
Overrides in primaryModel or fasterModel are merged with the top-level defaults:
Simple fields (
id,baseUrl,apiKey,apiType,temperature) are replaced by the override value when present.Headers (
extraHeaders) are merged: headers defined in the override are added to the top-level headers. If the same header key appears in both, the role-level value takes precedence.
Supported API types
The apiType field controls which request format Junie uses when calling the endpoint.
Value | Description |
|---|---|
| OpenAI Chat Completions API ( |
| OpenAI Responses API ( |
| Google Gemini API format. Use this for Google AI Studio or Vertex AI endpoints. |
| Anthropic Messages API format. Use this for Anthropic Claude endpoints. |
Temperature
By default, Junie does not send a temperature value for custom models, allowing the provider to use its own default. You can set a specific temperature at the top level (shared by both model roles) or override it per role.
Recommended temperature values vary by model. For example:
Model | Recommended temperature |
|---|---|
DeepSeek | 0 |
Gemini | 1 |
Kimi | 0.6–1 |
GLM | 0.7 |
Qwen | 0.6 |
MiMo | 0.3 |
Example profiles
Basic profile
Below is an example of a profile named local-ollama.json:
In this example, the primary model will be qwen3-coder:latest, and the faster model will be qwen2.5-coder:1.5b. Both will use the same base URL, API type, and extra headers.
Profile with temperature
Below is an example that sets a default temperature and overrides it for the primary model:
In this example, the primary model uses temperature 0.3 (overridden), while the faster model inherits the top-level temperature 0.6.
Using custom models
Once a profile is created, you can select it using the /model command or the --model flag. Custom models are identified by a custom: prefix followed by the profile ID:
In the interactive TUI, custom models appear in the model selection list after the built-in providers.