Skip to content

Feature/add mistral generator#1135

Merged
jmartin-tech merged 9 commits intoNVIDIA:mainfrom
dimensi0n:feature/mistral-generator
Apr 18, 2025
Merged

Feature/add mistral generator#1135
jmartin-tech merged 9 commits intoNVIDIA:mainfrom
dimensi0n:feature/mistral-generator

Conversation

@dimensi0n
Copy link
Contributor

Mistral is an advanced language model that offers powerful and precise text generation capabilities. It has been specifically designed to follow precise instructions, reason, handle multi-turn conversations, and generate code. By integrating Mistral into Garak, we enable users to test this state-of-the-art model against various attacks and vulnerabilities, ensuring safer and more reliable use in real-world applications.

Verification

$ export MISTRAL_API_KEY=abcdefg123456789
$ python3 -m garak --model_type mistral --model_name mistral-small-latest --probes test.Blank

The default model name is [mistral-large-latest] (https://mistral.ai/fr/news/mistral-large-2407)

@github-actions
Copy link
Contributor

github-actions bot commented Mar 22, 2025

DCO Assistant Lite bot All contributors have signed the DCO ✍️ ✅

@dimensi0n
Copy link
Contributor Author

I have read the DCO Document and I hereby sign the DCO

@dimensi0n
Copy link
Contributor Author

recheck

github-actions bot added a commit that referenced this pull request Mar 22, 2025
Copy link
Collaborator

@jmartin-tech jmartin-tech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a good first pass, API keys and default values are part for the Configurable plugin implementation. I have offered a refactor that would move this validation and default to enable our yaml and json based configuration to work with this generator.

It would be helpful to have a few example generation responses as mocks for pytests added to validate this new generator code.

dimensi0n and others added 3 commits March 24, 2025 15:06
Co-authored-by: Jeffrey Martin <jmartin@Op3n4M3.dev>
Signed-off-by: Erwan ROUSSEL <e-roussel@outlook.com>
@dimensi0n
Copy link
Contributor Author

How to add the mistral api key for the pytests in github actions ?

@jmartin-tech
Copy link
Collaborator

How to add the mistral api key for the pytests in github actions ?

Tests can exist that require a key for usage in integration testing however, these test are not run in CI.

Github actions will not use a live API key, tests should exists that mock the http response and intercept the API call.

@dimensi0n
Copy link
Contributor Author

Here we go, we have a mock prompt test, pytests should be fine now.

@dimensi0n
Copy link
Contributor Author

dimensi0n commented Mar 25, 2025

Thanks for the example, it was a hard path to find how to create the mock file but I found this on my way https://github.com/mistralai/client-python/blob/main/docs/models/chatcompletionresponse.md. Should be done with the last commit

@dimensi0n dimensi0n requested a review from jmartin-tech March 25, 2025 15:59
Copy link
Collaborator

@jmartin-tech jmartin-tech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dimensi0n this is great progress, I noted a question about why the code is pushing a value into the environment that is explicitly passed to the client object and have requested some more work in the backoff handling.

Signed-off-by: Erwan ROUSSEL <e-roussel@outlook.com>
@dimensi0n dimensi0n requested a review from jmartin-tech March 26, 2025 13:58
@dimensi0n
Copy link
Contributor Author

Up

@jmartin-tech jmartin-tech self-assigned this Apr 10, 2025
@jmartin-tech jmartin-tech merged commit c4f1f88 into NVIDIA:main Apr 18, 2025
9 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Apr 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants