Skip to content

feat: support Anthropic, DeepSeek, Mistral and Gemini models (backport #172) - #173

Open
mergify[bot] wants to merge 1 commit into
version-16-hotfixfrom
mergify/bp/version-16-hotfix/pr-172
Open

mergify[bot] wants to merge 1 commit into
version-16-hotfixfrom
mergify/bp/version-16-hotfix/pr-172

Conversation

@mergify

@mergify mergify Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Ask ALYF can now use models from OpenAI, Anthropic, DeepSeek, Mistral and Gemini. Chat and vision models are built with LangChain's init_chat_model instead of ChatOpenAI and any-llm completions.

Changes

  • Settings: LLM Provider and Vision LLM Provider are Autocomplete fields with a label and a value for each provider. The value is the init_chat_model provider key, for example "google_genai". On save, the value must be one of the options.
  • Chat model: build_chat_model uses init_chat_model. It sends the API key and the base URL only when they are set. The Responses API stays for OpenAI only.
  • Vision model: document extraction uses the same model factory and ainvoke. The OpenAI-style image block stays, because the integrations convert it and it keeps detail: "high".
  • Reasoning effort: each integration takes the Reasoning Effort setting under its own name. OpenAI uses reasoning_effort, Anthropic uses effort and Gemini uses thinking_level. Gemini has no level above "high", so "xhigh" and "max" become "high". DeepSeek and Mistral get no reasoning argument, and the field is hidden for them. The warning for unsupported levels stays OpenAI-only, because only LangChain's OpenAI model data lists the levels.
  • No temperature: newer models (for example gpt-5.x and recent Claude models) reject non-default values with a 400 error. Each provider now uses its default.
  • Harness profile: Deep Agents finds a harness profile by the provider name that the model reports. The profile was registered for "openai" only, so other providers would get write_file, edit_file and execute again. The profile is now registered for the provider of the model that is built.
  • Model list: any-llm still lists the models. A small map changes the provider key to the any-llm name ("google_genai" → "gemini", "mistralai" → "mistral").
  • Form: Base URL and Vision API Key are optional. Reasoning Effort shows only for OpenAI, Anthropic and Gemini.
  • Dependencies: langchain-anthropic, langchain-deepseek, langchain-google-genai, langchain-mistralai and any-llm-sdk[mistral].
  • Patch: changes the old values "OpenAI" and "OpenAI Compatible" to "openai". An OpenAI-compatible endpoint is now "openai" with a Base URL.

Migration

Install the new Python requirements (for example bench setup requirements), then run bench migrate.

Known limits

  • The capability checks on save (tool calling, vision) use LiteLLM with OpenAI names. For other providers, models are usually unknown to this check and are allowed.
  • Document extraction no longer sends response_format=json_object, which only OpenAI supports. It uses the prompt and the existing JSON parser.
  • If the API key is missing, the user sees the provider's error message, not an Ask ALYF message.

Tests

  • Unit tests for reasoning effort per provider, document extraction with a shared and a separate vision model, provider mapping, provider validation, the model factory, the harness profile for OpenAI and Anthropic, and no temperature in the Anthropic request.
  • The full app test suite passes.
  • The tests use fake API keys. A manual test with a real Anthropic model found the temperature error that this PR fixes.

This is an automatic backport of pull request #172 done by [Mergify](https://mergify.com).

* feat: support Anthropic, DeepSeek, Mistral and Gemini models

Build chat and vision models with LangChain's `init_chat_model`
instead of `ChatOpenAI` and any-llm completions.

- LLM Provider and Vision LLM Provider are Autocomplete fields with
  OpenAI, Anthropic, DeepSeek, Mistral and Gemini. Validate the value
  on save.
- Register the harness profile for the provider that the model
  reports, so write and execute tools stay excluded for all providers.
- Do not send a temperature. Newer models reject non-default values.
- Make Base URL and Vision API Key optional.
- Show Reasoning Effort only for OpenAI.
- Add a patch that changes "OpenAI" and "OpenAI Compatible" to "openai".

* fix: make provider credentials optional and test document extraction

- Remove the remaining mandatory conditions from Base URL, Vision Base
  URL and Vision API Key. A separate vision model can now read its
  credentials from the environment, and the old "OpenAI Compatible"
  conditions could no longer be true.
- Add tests for document extraction with a shared and a separate vision
  model. They check the credentials, the image message and the parsed
  model response.

* feat: support reasoning effort for Anthropic and Gemini

Each integration takes the Reasoning Effort setting under its own name:
OpenAI as `reasoning_effort`, Anthropic as `effort` and Gemini as
`thinking_level`. Gemini has no level above "high", so "xhigh" and
"max" become "high". DeepSeek and Mistral get no reasoning argument.

The warning for unsupported levels stays OpenAI-only, because only
LangChain's OpenAI model data lists the supported levels.

* refactor: move provider patch out of the v1_0 folder

(cherry picked from commit 9f16aea)
@greptile-apps

greptile-apps Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] The backport appears safe to merge; no actionable defect was identified.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  Settings[Chat and vision settings] --> Factory[Shared LangChain model factory]
  Factory --> Chat[Chat model]
  Factory --> Vision[Vision model]
  Chat --> Profile[Register provider tool exclusions]
  Profile --> Main[Main agent and specialists]
  Chat --> Field[Field agent]
  Vision --> Images[Send text and image blocks]
  Images --> JSON[Parse returned JSON]
  Settings --> Listing[Map provider key for model listing]
Loading

Reviews (1) · Last reviewed commit: "feat: support Anthropic, DeepSeek, Mistr..." · Reviewed by Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant