Codestral 2508 یا Saba؟
هر دو با همان کلید و همان کد در یوتاپن کار میکنند؛ فقط مقدار model عوض میشود. پس میتوانی بدون تغییر معماری، هر دو را روی کار واقعی خودت تست کنی. از نظر هزینه، Saba حدود ۱٫۵ برابر ارزانتر تمام میشود.
| ویژگی | ||
|---|---|---|
| تأمینکننده | Mistral | Mistral |
| شناسهٔ مدل | mistralai/codestral-2508 | mistralai/mistral-saba |
| context | 256,000 توکن | 32,768 توکن |
| حداکثر خروجی | 204,800 توکن | 26,214 توکن |
| ورودی / ۱M توکن | 87,038 تومان | 58,025 تومان |
| خروجی / ۱M توکن | 261,113 تومان | 174,075 تومان |
| ≈ یک درخواست ۱٬۰۰۰ کلمهای | 453 تومان | 302 تومان |
| cache ورودی | 8,704 تومان / ۱M | 5,803 تومان / ۱M |
| ورودی تصویر | ندارد | ندارد |
| ورودی فایل | دارد | دارد |
| tool calling | دارد | دارد |
| خروجی JSON | دارد | دارد |
| حالت استدلال | ندارد | ندارد |
کدام برای چه کاری؟
تست هر دو با یک کد
فقط model را بین دو شناسه عوض کن و همان درخواست را دو بار بفرست؛ هزینهٔ هر پاسخ در هدر X-Uttapen-Cost-Toman برمیگردد.
curl https://api.uttapen.ir/v1/chat/completions \
-H "Authorization: Bearer sk-up-…" \
-H "Content-Type: application/json" \
-d '{
"model": "mistralai/codestral-2508",
"messages": [{"role": "user", "content": "سلام! خودت را معرفی کن."}],
"stream": true
}'from openai import OpenAI
client = OpenAI(
base_url="https://api.uttapen.ir/v1",
api_key="sk-up-…",
)
stream = client.chat.completions.create(
model="mistralai/codestral-2508",
messages=[{"role": "user", "content": "سلام! خودت را معرفی کن."}],
stream=True,
)
for chunk in stream:
print(chunk.choices[0].delta.content or "", end="", flush=True)import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.uttapen.ir/v1",
apiKey: "sk-up-…",
});
const stream = await client.chat.completions.create({
model: "mistralai/codestral-2508",
messages: [{ role: "user", content: "سلام! خودت را معرفی کن." }],
stream: true,
});
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}<?php
// composer require openai-php/client guzzlehttp/guzzle
$client = OpenAI::factory()
->withBaseUri('https://api.uttapen.ir/v1')
->withApiKey('sk-up-…')
->make();
$result = $client->chat()->create([
'model' => 'mistralai/codestral-2508',
'messages' => [['role' => 'user', 'content' => 'سلام! خودت را معرفی کن.']],
]);
echo $result->choices[0]->message->content;package main
import (
"context"
"fmt"
"github.com/openai/openai-go"
"github.com/openai/openai-go/option"
)
func main() {
client := openai.NewClient(
option.WithBaseURL("https://api.uttapen.ir/v1"),
option.WithAPIKey("sk-up-…"),
)
resp, err := client.Chat.Completions.New(context.Background(), openai.ChatCompletionNewParams{
Model: "mistralai/codestral-2508",
Messages: []openai.ChatCompletionMessageParamUnion{openai.UserMessage("سلام! خودت را معرفی کن.")},
})
if err != nil {
panic(err)
}
fmt.Println(resp.Choices[0].Message.Content)
}model = "mistralai/mistral-saba"
مقایسههای دیگر: همهٔ جفتها · رتبهبندی مدلها · فهرست کامل
base_url = https://api.uttapen.ir/v1