Skip to content

feat(llm): add built-in Mistral AI provider preset #780

Closed

Description

@xavierpestel-ai

Hi maintainers,

Following the pattern of the recently merged provider presets — Eden AI (#346), Ollama Cloud (#375), and LiteLLM (#385) — I would like to propose adding Mistral AI as a built-in provider, so users can select it with:

ocr config set provider mistral
ocr config set model codestral-latest

Disclosure

I work at Mistral AI. This is a personal contribution submitted under the same preset pattern as the three PRs above; it does not ask for any special treatment relative to those.

Proposed change

One entry in internal/llm/providers.go using the existing ProtocolOpenAIChatCompletions. Mistral's Chat Completions endpoint at https://api.mistral.ai/v1 is OpenAI-compatible — verified locally by a raw HTTP smoke test and by an end-to-end ocr review run against a small staged diff.

No changes to client.go, protocol.go, resolver.go, action.yml, go.mod, or the GitHub Action inputs.

Models (deliberately minimal)

The preset only seeds the interactive picker; users can select any Mistral model via ocr config set model <name>.

  • codestral-latest
  • mistral-large-latest
  • mistral-small-latest

Auth

MISTRAL_API_KEY environment variable.

Tests

Mirrors TestLookupProvider_LiteLLMDetails in providers_test.go.

Local verification already done

  • make check passes (license, gofmt, vet, mod tidy).
  • Unit tests pass (TestLookupProvider_MistralDetails, TestListProviders_Order, TestProviders_AllProtocolsCanonical).
  • make build passes.
  • internal/llm package coverage: 94.3 % (100 % on providers.go).
  • Raw HTTP call to POST https://api.mistral.ai/v1/chat/completions returned an OpenAI-shape response.
  • End-to-end ocr review on a scratch repo containing a staged SQL injection returned a line-precise finding.

Companion draft PR

Concrete diff is available for inspection as a draft PR: #781. I am not requesting review on the PR until you confirm the direction here. If a different shape would suit the project better — or if the timing is wrong — I'll close the PR and adjust.

Thanks.

Activity

  1. wu21-web commented on Aug 8, 2026

    @wu21-web
    Contributor

    This issue should be closed.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions