Codestral 22b
Approved Data Classifications
Description
Codestral-22B is a powerful AI model developed by Mistral AI, specifically designed for code generation tasks across a wide array of programming languages. Launched in May 2024, this model features 22 billion parameters and is trained on a diverse dataset encompassing over 80 programming languages, including popular ones like Python, Java, C++, and JavaScript. Codestral-22B excels in various coding-related tasks, such as generating code snippets, completing partial code using its fill-in-the-middle mechanism, and providing explanations or documentation for existing code. Its advanced capabilities allow developers to streamline their workflow, reduce errors, and enhance productivity in software development projects. However, it is important to note that Codestral-22B lacks built-in moderation mechanisms, which may limit its deployment in environments that require controlled outputs.
Capabilities
Model | Training Data | Input | Output | Context Length | Cost (per 1 million tokens) |
---|---|---|---|---|---|
codestral-22b | May 2024 | Text | Text | 32,000 | $0.20/1M input $0.60/1M output |
1M
represents 1 Million Tokens- All prices listed are based on 1 Million Tokens
Availability
Cloud Provider
Usage
- curl
- python
- javascript
curl -X POST https://api.ai.it.ufl.edu/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <API_TOKEN>" \
-d '{
"model": "codestral-22b",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Write a haiku about an Alligator."
}
]
}'
from openai import OpenAI
client = OpenAI(
api_key="your_api_key",
base_url="https://api.ai.it.ufl.edu/v1"
)
response = client.chat.completions.create(
model="codestral-22b", # model to send to the proxy
messages = [
{ role: "system", content: "You are a helpful assistant." },
{
"role": "user",
"content": "Write a haiku about an Alligator."
}
]
)
print(response.choices[0].message)
import OpenAI from 'openai';
const openai = new OpenAI({
apiKey: 'your_api_key',
baseURL: 'https://api.ai.it.ufl.edu/v1'
});
const completion = await openai.chat.completions.create({
model: "codestral-22b",
messages: [
{ role: "system", content: "You are a helpful assistant." },
{
role: "user",
content: "Write a haiku about an Alligator.",
},
],
});
print(completion.choices[0].message)