1 line
22 KiB
JSON
1 line
22 KiB
JSON
{"repo": "albertovasquez/done", "files": {"upstream/docs/models/quickstart.md": {"5a4e21b3fe167e8f440e528d386cae0e563f71be": {"t": 1785746499.5314946, "n": 10513, "h": "669543564901628b", "c": "# Model setup quickstart\n\n!!! tip \"Setup\"\n\n * In most cases, you can simply run `mini-extra config setup` to set up your default model and API keys.\n This should be run the first time you run `mini`.\n * By default we support all models using [`litellm`](https://github.com/BerriAI/litellm).\n * We also offer support for models via [Openrouter](https://openrouter.ai/) and [Portkey](https://portkey.ai/).\n\n## Setting API keys\n\nThere are several ways to set your API keys:\n\n* **Recommended**: Run our setup script: `mini-extra config setup`. This should also run automatically the first time you run `mini`.\n* Use `mini-extra config set ANTHROPIC_API_KEY <your-api-key>` to put the key in the `mini` [config file](../advanced/global_configuration.md).\n* Export your key as an environment variable: `export ANTHROPIC_API_KEY=<your-api-key>` (this is not persistent if you restart your shell, unless you add it to your shell config, like `~/.bashrc` or `~/.zshrc`).\n* If you run several agents in parallel, see our note about rotating anthropic keys [here](../advanced/global_configuration.md).\n\n??? note \"All the API key names\"\n\n We use [`litellm`](https://github.com/BerriAI/litellm) to support most models.\n Here's a list of all the API key names available in `litellm`:\n\n ```\n ALEPH_ALPHA_API_KEY\n ALEPHALPHA_API_KEY\n ANTHROPIC_API_KEY\n ANYSCALE_API_KEY\n AZURE_AI_API_KEY\n AZURE_API_KEY\n AZURE_OPENAI_API_KEY\n BASETEN_API_KEY\n CEREBRAS_API_KEY\n CLARIFAI_API_KEY\n CLOUDFLARE_API_KEY\n CO_API_KEY\n CODESTRAL_API_KEY\n COHERE_API_KEY\n DATABRICKS_API_KEY\n DEEPINFRA_API_KEY\n DEEPSEEK_API_KEY\n FEATHERLESS_AI_API_KEY\n FIREWORKS_AI_API_KEY\n FIREWORKS_API_KEY\n FIREWORKSAI_API_KEY\n GEMINI_API_KEY\n GROQ_API_KEY\n HUGGINGFACE_API_KEY\n INFINITY_API_KEY\n MARITALK_API_KEY\n MISTRAL_API_KEY\n NEBIUS_API_KEY\n NLP_CLOUD_API_KEY\n NOVITA_API_KEY\n NVIDIA_NIM_API_KEY\n OLLAMA_API_KEY\n OPENAI_API_KEY\n OPENAI_LIKE_API_KEY\n OPENROUTER_API_KEY\n OR_API_KEY\n PALM_API_KEY\n PERPLEXITYAI_API_KEY\n PREDIBASE_API_KEY\n PROVIDER_API_KEY\n REPLICATE_API_KEY\n TOGETHERAI_API_KEY\n VOLCENGINE_API_KEY\n VOYAGE_API_KEY\n WATSONX_API_KEY\n WX_API_KEY\n XAI_API_KEY\n XINFERENCE_API_KEY\n ```\n\n In addition, Portkey models use the `PORTKEY_API_KEY` environment variable.\n\n## Selecting a model\n\n!!! note \"Model names and providers.\"\n\n We support most models using [`litellm`](https://github.com/BerriAI/litellm).\n You can find a list of their supported models [here](https://docs.litellm.ai/docs/providers).\n Please always include the provider in the model name, e.g., `anthropic/claude-...`.\n\n* **Recommended**: `mini-extra config setup` (should be run the first time you run `mini`) can set the default model for you\n* All command line interfaces allow you to set the model name with `-m` or `--model`.\n* In addition, you can set the default model with `mini-extra config set MSWEA_MODEL_NAME <model-name>`, by editing the global [config file](../advanced/global_configuration.md) (shortcut: `mini-extra config edit`), or by setting the `MSWEA_MODEL_NAME` environment variable.\n* You can also set your model in a config file (key `model_name` under `model`).\n* If you want to use local models, please check this [guide](local_models.md).\n\n!!! note \"Popular models\"\n\n Here's a few examples of popular models:\n\n ```\n anthropic/claude-opus-4-6-20260205\n openai/gpt-5.4\n openai/gpt-5.4-mini\n gemini/gemini-2.5-pro\n deepseek/deepseek-chat\n ```\n\n ??? note \"List of all supported models\"\n\n Here's a list of all model names supported by `litellm` as of Aug 29th 2025.\n For even more recent models, check the [`model_prices_and_context_window.json` file from litellm](https://github.com/BerriAI/litellm/blob/main/model_prices_and_context_window.json).\n\n ```\n --8<-- \"docs/data/all_models.txt\"\n ```\n\nTo find the corresponding API key, check the previous section.\n\n## Extra model settings\n\nTo configure reasoning efforts or similar settings, you need to edit the [agent config file](../advanced/yaml_configuration.md).\nIn newer versions, the location of the config file is printed when you run `mini` (\"agent config\" in the output).\n\nHere's a few general examples:\n\n=== \"Temperature\"\n\n `litellm` allows to set model-specific settings with the `model_kwargs` key:\n\n ```yaml\n model:\n model_name: \"anthropic/claude-sonnet-4-5-20250929\"\n model_kwargs:\n temperature: 0.0\n ```\n\n Note that temperature isn't supported by all models.\n\n=== \"GPT-5 reasoning effort (Chat Completions API)\"\n\n `litellm` allows to set model-specific settings with the `model_kwargs` key:\n\n ```yaml\n model:\n model_name: \"openai/gpt-5-mini\"\n model_kwargs:\n drop_params: true\n reasoning_effort: \"high\"\n verbosity: \"medium\"\n ```\n\n Here, `drop_params` is used to drop any parameters that are not supported by the model.\n\n=== \"GPT-5 with Responses API\"\n\n For OpenAI models that support the Responses API, you can use the `litellm_response_toolcall` model class:\n\n ```yaml\n model:\n model_class: \"litellm_response_toolcall\"\n model_name: \"openai/gpt-5-mini\"\n model_kwargs:\n drop_params: true\n reasoning:\n effort: \"high\"\n ```\n\n=== \"OpenRouter\"\n\n This example explicitly sets the model class to `openrouter` (see the next section for more details).\n It also explicitly sets the providers to disable switching between them (this is useful if you need\n very consistent cost behavior, e.g., for benchmarking, but it's not recommended if you're just interested\n in getting low latency and good prices).\n\n ```yaml\n model:\n model_name: \"moonshotai/kimi-k2-0905\"\n model_class: \"openrouter\"\n model_kwargs:\n temperature: 0.0\n provider:\n allow_fallbacks: false\n only: [\"Moonshot AI\"]\n ```\n\n=== \"Local models\"\n\n Using `litellm` with local models:\n\n ```yaml\n model:\n model_name: \"my-local-model\"\n model_kwargs:\n custom_llm_provider: \"openai\"\n api_base: \"https://...\"\n ...\n ```\n\n See [this guide](local_models.md) for more details on local models.\n In particular, you need to configure token costs for local models.\n\nHere are more examples of how to configure specific models:\n\n=== \"Gemini 3 (Openrouter)\"\n\n ```yaml\n model:\n model_name: \"google/gemini-3-pro-preview\"\n model_class: openrouter\n model_kwargs:\n temperature: 0.0\n ```\n\n=== \"GPT 5.1 medium (Portkey)\"\n\n ```yaml\n model:\n model_name: \"@openai/gpt-5.1\"\n model_class: portkey\n model_kwargs:\n reasoning_effort: \"medium\"\n verbosity: \"medium\"\n ```\n\n=== \"Claude Haiku 4.5\"\n\n ```yaml\n model:\n model_name: \"anthropic/claude-haiku-4-5-20251001\"\n model_kwargs:\n temperature: 0.0\n ```\n\n=== \"GPT 5 mini (Portkey)\"\n\n ```yaml\n model:\n model_name: \"@openai/gpt-5-mini\"\n model_class: portkey\n ```\n\n=== \"Deepseek\"\n\n ```yaml\n model:\n model_name: \"deepseek/deepseek-reasoner\"\n model_kwargs:\n temperature: 0.0\n ```\n\n=== \"Minimax (Openrouter)\"\n\n ```yaml\n model:\n model_name: \"minimax/minimax-m2\"\n model_class: openrouter\n model_kwargs:\n temperature: 0.0\n ```\n\n## Model classes\n\nWe support the various models through different backends.\nBy default (if you only specify the model name), we pick the best backend for you.\nThis will almost always default to `litellm` (with Anthropic models being a special case as they need to have explicit cache breakpoint handling).\n\nHowever, there are a few other backends that you can use and specify with the `--model-class` flag or the\n`model.model_class` key in the agent config file (see previous section).\n\nFor example:\n\n=== \"Openrouter model\"\n\n ```bash\n mini -m \"moonshotai/kimi-k2-0905\" --model-class openrouter\n ```\n\n **Alternatively:** In the agent config file:\n\n ```yaml\n model:\n model_name: \"moonshotai/kimi-k2-0905\"\n model_class: openrouter\n ```\n\n=== \"Portkey model\"\n\n ```bash\n mini -m \"claude-sonnet-4-5-20250929\" --model-class portkey\n ```\n\n **Alternatively:** In the agent config file:\n ```yaml\n model:\n model_name: \"claude-sonnet-4-5-20250929\"\n model_class: portkey\n ```\n\n\n* **`litellm`** ([`LitellmModel`](../reference/models/litellm.md)) - **Default and recommended**. Supports most models through [litellm](https://github.com/BerriAI/litellm). Works with OpenAI, Anthropic, Google, and many other providers. Anthropic models automatically get cache control settings when the model name contains \"anthropic\", \"claude\", \"sonnet\", or \"opus\".\n\n* **`litellm_response`** ([`LitellmResponseModel`](../reference/models/litellm_response_toolcall.md)) - Specialized version of `LitellmModel` that uses OpenAI's Responses API with native tool calling. Useful for models like GPT-5 and required for models like GPT-5-codex. Maintains conversation state across turns.\n\n* **`openrouter`** ([`OpenRouterModel`](../reference/models/openrouter.md)) - Direct integration with [OpenRouter](https://openrouter.ai/) API for accessing various models through a single endpoint.\n\n* **`portkey`** ([`PortkeyModel`](../reference/models/portkey.md)) - Integration with [Portkey](https://portkey.ai/) for accessing various models with enhanced observability, caching, and routing features. Note that this still uses `litellm` to calculate costs.\n\nOn top, there's a few more exotic model classes that you can use:\n\n* **`deterministic`** ([`DeterministicModel`](../reference/models/test_models.md)) - Returns predefined responses for testing and development purposes.\n* **`minisweagent.models.extra.roulette.RouletteModel` and `minisweagent.models.extra.roulette.InterleavingModel`** ([`RouletteModel`](../reference/models/extra.md) and [`InterleavingModel`](../reference/models/extra.md)) - Randomly selects or interleaves multiple configured models for each query. See [this blog post](https://www.swebench.com/SWE-bench/blog/2025/08/19/mini-roulette/) for more details.\n\nAs with the last two, you can also specify any import path to your own custom model class (even if it is not yet part of the mini-SWE-agent package).\n\n--8<-- \"docs/_footer.md\"\n\n"}, "462a1f68e839e0f0fbb36f9a5b86b430069ee484": {"t": 1785764985.5367386, "n": 10513, "h": "669543564901628b", "c": "# Model setup quickstart\n\n!!! tip \"Setup\"\n\n * In most cases, you can simply run `mini-extra config setup` to set up your default model and API keys.\n This should be run the first time you run `mini`.\n * By default we support all models using [`litellm`](https://github.com/BerriAI/litellm).\n * We also offer support for models via [Openrouter](https://openrouter.ai/) and [Portkey](https://portkey.ai/).\n\n## Setting API keys\n\nThere are several ways to set your API keys:\n\n* **Recommended**: Run our setup script: `mini-extra config setup`. This should also run automatically the first time you run `mini`.\n* Use `mini-extra config set ANTHROPIC_API_KEY <your-api-key>` to put the key in the `mini` [config file](../advanced/global_configuration.md).\n* Export your key as an environment variable: `export ANTHROPIC_API_KEY=<your-api-key>` (this is not persistent if you restart your shell, unless you add it to your shell config, like `~/.bashrc` or `~/.zshrc`).\n* If you run several agents in parallel, see our note about rotating anthropic keys [here](../advanced/global_configuration.md).\n\n??? note \"All the API key names\"\n\n We use [`litellm`](https://github.com/BerriAI/litellm) to support most models.\n Here's a list of all the API key names available in `litellm`:\n\n ```\n ALEPH_ALPHA_API_KEY\n ALEPHALPHA_API_KEY\n ANTHROPIC_API_KEY\n ANYSCALE_API_KEY\n AZURE_AI_API_KEY\n AZURE_API_KEY\n AZURE_OPENAI_API_KEY\n BASETEN_API_KEY\n CEREBRAS_API_KEY\n CLARIFAI_API_KEY\n CLOUDFLARE_API_KEY\n CO_API_KEY\n CODESTRAL_API_KEY\n COHERE_API_KEY\n DATABRICKS_API_KEY\n DEEPINFRA_API_KEY\n DEEPSEEK_API_KEY\n FEATHERLESS_AI_API_KEY\n FIREWORKS_AI_API_KEY\n FIREWORKS_API_KEY\n FIREWORKSAI_API_KEY\n GEMINI_API_KEY\n GROQ_API_KEY\n HUGGINGFACE_API_KEY\n INFINITY_API_KEY\n MARITALK_API_KEY\n MISTRAL_API_KEY\n NEBIUS_API_KEY\n NLP_CLOUD_API_KEY\n NOVITA_API_KEY\n NVIDIA_NIM_API_KEY\n OLLAMA_API_KEY\n OPENAI_API_KEY\n OPENAI_LIKE_API_KEY\n OPENROUTER_API_KEY\n OR_API_KEY\n PALM_API_KEY\n PERPLEXITYAI_API_KEY\n PREDIBASE_API_KEY\n PROVIDER_API_KEY\n REPLICATE_API_KEY\n TOGETHERAI_API_KEY\n VOLCENGINE_API_KEY\n VOYAGE_API_KEY\n WATSONX_API_KEY\n WX_API_KEY\n XAI_API_KEY\n XINFERENCE_API_KEY\n ```\n\n In addition, Portkey models use the `PORTKEY_API_KEY` environment variable.\n\n## Selecting a model\n\n!!! note \"Model names and providers.\"\n\n We support most models using [`litellm`](https://github.com/BerriAI/litellm).\n You can find a list of their supported models [here](https://docs.litellm.ai/docs/providers).\n Please always include the provider in the model name, e.g., `anthropic/claude-...`.\n\n* **Recommended**: `mini-extra config setup` (should be run the first time you run `mini`) can set the default model for you\n* All command line interfaces allow you to set the model name with `-m` or `--model`.\n* In addition, you can set the default model with `mini-extra config set MSWEA_MODEL_NAME <model-name>`, by editing the global [config file](../advanced/global_configuration.md) (shortcut: `mini-extra config edit`), or by setting the `MSWEA_MODEL_NAME` environment variable.\n* You can also set your model in a config file (key `model_name` under `model`).\n* If you want to use local models, please check this [guide](local_models.md).\n\n!!! note \"Popular models\"\n\n Here's a few examples of popular models:\n\n ```\n anthropic/claude-opus-4-6-20260205\n openai/gpt-5.4\n openai/gpt-5.4-mini\n gemini/gemini-2.5-pro\n deepseek/deepseek-chat\n ```\n\n ??? note \"List of all supported models\"\n\n Here's a list of all model names supported by `litellm` as of Aug 29th 2025.\n For even more recent models, check the [`model_prices_and_context_window.json` file from litellm](https://github.com/BerriAI/litellm/blob/main/model_prices_and_context_window.json).\n\n ```\n --8<-- \"docs/data/all_models.txt\"\n ```\n\nTo find the corresponding API key, check the previous section.\n\n## Extra model settings\n\nTo configure reasoning efforts or similar settings, you need to edit the [agent config file](../advanced/yaml_configuration.md).\nIn newer versions, the location of the config file is printed when you run `mini` (\"agent config\" in the output).\n\nHere's a few general examples:\n\n=== \"Temperature\"\n\n `litellm` allows to set model-specific settings with the `model_kwargs` key:\n\n ```yaml\n model:\n model_name: \"anthropic/claude-sonnet-4-5-20250929\"\n model_kwargs:\n temperature: 0.0\n ```\n\n Note that temperature isn't supported by all models.\n\n=== \"GPT-5 reasoning effort (Chat Completions API)\"\n\n `litellm` allows to set model-specific settings with the `model_kwargs` key:\n\n ```yaml\n model:\n model_name: \"openai/gpt-5-mini\"\n model_kwargs:\n drop_params: true\n reasoning_effort: \"high\"\n verbosity: \"medium\"\n ```\n\n Here, `drop_params` is used to drop any parameters that are not supported by the model.\n\n=== \"GPT-5 with Responses API\"\n\n For OpenAI models that support the Responses API, you can use the `litellm_response_toolcall` model class:\n\n ```yaml\n model:\n model_class: \"litellm_response_toolcall\"\n model_name: \"openai/gpt-5-mini\"\n model_kwargs:\n drop_params: true\n reasoning:\n effort: \"high\"\n ```\n\n=== \"OpenRouter\"\n\n This example explicitly sets the model class to `openrouter` (see the next section for more details).\n It also explicitly sets the providers to disable switching between them (this is useful if you need\n very consistent cost behavior, e.g., for benchmarking, but it's not recommended if you're just interested\n in getting low latency and good prices).\n\n ```yaml\n model:\n model_name: \"moonshotai/kimi-k2-0905\"\n model_class: \"openrouter\"\n model_kwargs:\n temperature: 0.0\n provider:\n allow_fallbacks: false\n only: [\"Moonshot AI\"]\n ```\n\n=== \"Local models\"\n\n Using `litellm` with local models:\n\n ```yaml\n model:\n model_name: \"my-local-model\"\n model_kwargs:\n custom_llm_provider: \"openai\"\n api_base: \"https://...\"\n ...\n ```\n\n See [this guide](local_models.md) for more details on local models.\n In particular, you need to configure token costs for local models.\n\nHere are more examples of how to configure specific models:\n\n=== \"Gemini 3 (Openrouter)\"\n\n ```yaml\n model:\n model_name: \"google/gemini-3-pro-preview\"\n model_class: openrouter\n model_kwargs:\n temperature: 0.0\n ```\n\n=== \"GPT 5.1 medium (Portkey)\"\n\n ```yaml\n model:\n model_name: \"@openai/gpt-5.1\"\n model_class: portkey\n model_kwargs:\n reasoning_effort: \"medium\"\n verbosity: \"medium\"\n ```\n\n=== \"Claude Haiku 4.5\"\n\n ```yaml\n model:\n model_name: \"anthropic/claude-haiku-4-5-20251001\"\n model_kwargs:\n temperature: 0.0\n ```\n\n=== \"GPT 5 mini (Portkey)\"\n\n ```yaml\n model:\n model_name: \"@openai/gpt-5-mini\"\n model_class: portkey\n ```\n\n=== \"Deepseek\"\n\n ```yaml\n model:\n model_name: \"deepseek/deepseek-reasoner\"\n model_kwargs:\n temperature: 0.0\n ```\n\n=== \"Minimax (Openrouter)\"\n\n ```yaml\n model:\n model_name: \"minimax/minimax-m2\"\n model_class: openrouter\n model_kwargs:\n temperature: 0.0\n ```\n\n## Model classes\n\nWe support the various models through different backends.\nBy default (if you only specify the model name), we pick the best backend for you.\nThis will almost always default to `litellm` (with Anthropic models being a special case as they need to have explicit cache breakpoint handling).\n\nHowever, there are a few other backends that you can use and specify with the `--model-class` flag or the\n`model.model_class` key in the agent config file (see previous section).\n\nFor example:\n\n=== \"Openrouter model\"\n\n ```bash\n mini -m \"moonshotai/kimi-k2-0905\" --model-class openrouter\n ```\n\n **Alternatively:** In the agent config file:\n\n ```yaml\n model:\n model_name: \"moonshotai/kimi-k2-0905\"\n model_class: openrouter\n ```\n\n=== \"Portkey model\"\n\n ```bash\n mini -m \"claude-sonnet-4-5-20250929\" --model-class portkey\n ```\n\n **Alternatively:** In the agent config file:\n ```yaml\n model:\n model_name: \"claude-sonnet-4-5-20250929\"\n model_class: portkey\n ```\n\n\n* **`litellm`** ([`LitellmModel`](../reference/models/litellm.md)) - **Default and recommended**. Supports most models through [litellm](https://github.com/BerriAI/litellm). Works with OpenAI, Anthropic, Google, and many other providers. Anthropic models automatically get cache control settings when the model name contains \"anthropic\", \"claude\", \"sonnet\", or \"opus\".\n\n* **`litellm_response`** ([`LitellmResponseModel`](../reference/models/litellm_response_toolcall.md)) - Specialized version of `LitellmModel` that uses OpenAI's Responses API with native tool calling. Useful for models like GPT-5 and required for models like GPT-5-codex. Maintains conversation state across turns.\n\n* **`openrouter`** ([`OpenRouterModel`](../reference/models/openrouter.md)) - Direct integration with [OpenRouter](https://openrouter.ai/) API for accessing various models through a single endpoint.\n\n* **`portkey`** ([`PortkeyModel`](../reference/models/portkey.md)) - Integration with [Portkey](https://portkey.ai/) for accessing various models with enhanced observability, caching, and routing features. Note that this still uses `litellm` to calculate costs.\n\nOn top, there's a few more exotic model classes that you can use:\n\n* **`deterministic`** ([`DeterministicModel`](../reference/models/test_models.md)) - Returns predefined responses for testing and development purposes.\n* **`minisweagent.models.extra.roulette.RouletteModel` and `minisweagent.models.extra.roulette.InterleavingModel`** ([`RouletteModel`](../reference/models/extra.md) and [`InterleavingModel`](../reference/models/extra.md)) - Randomly selects or interleaves multiple configured models for each query. See [this blog post](https://www.swebench.com/SWE-bench/blog/2025/08/19/mini-roulette/) for more details.\n\nAs with the last two, you can also specify any import path to your own custom model class (even if it is not yet part of the mini-SWE-agent package).\n\n--8<-- \"docs/_footer.md\"\n\n"}}}} |