codestral is an R package that provides an RStudio addin for interacting with Mistral AI models using their API. It supports both Fill-in-the-Middle (FIM) code completion and chat functionality.
Features
- Fill-in-the-Middle (FIM): Get code completion suggestions based on context
- Chat functionality: Interact with Codestral and Codestral Mamba models
- File inclusion: Easily include file contents in your prompts
- Package-aware: Automatically detects R package environments
Installation
You can install the development version from GitHub:
# install.packages("pak") pak::pak("urbs-dev/codestral")
Getting Started
For detailed usage instructions and examples, please refer to the codestral-introduction vignette.
Quick Setup
- Get your API keys from Mistral AI Platform
- Initialize the package:
library(codestral) codestral_init(mistral_apikey = "your-api-key-here", codestral_apikey = "your_codestral-api-key-here")
- Use the RStudio addin "Codestral code completion" to interact with the models
Documentation
library(codestral) vignette("codestral-introduction")
License
This package is licensed under the MIT License. See LICENSE for details.