49 lines
2.3 KiB
C++
49 lines
2.3 KiB
C++
#pragma once
|
|
|
|
// Static ceilings for the Mistral module. Never autotuned. Numbers marked
|
|
// "spec" come from the OpenAPI documents (SPEC.md ## Sources); the rest are
|
|
// our own hard caps.
|
|
|
|
#include <cstddef>
|
|
|
|
namespace molo::mistral {
|
|
|
|
struct MistralCaps {
|
|
// From the OpenAPI document.
|
|
static constexpr double kTemperatureMax = 1.5; // spec: 0..1.5
|
|
static constexpr double kPenaltyMax = 2.0; // spec: presence/frequency -2..2, repetition (0,2]
|
|
static constexpr int kBatchMaxInlineRequests = 10000; // spec: requests maxItems
|
|
static constexpr int kBatchTimeoutMinHours = 1; // spec: 1..168
|
|
static constexpr int kBatchTimeoutMaxHours = 168;
|
|
static constexpr int kLibraryChunkMin = 256; // spec: 256..32768
|
|
static constexpr int kLibraryChunkMax = 32768;
|
|
static constexpr std::size_t kTranscriptionFileUrlChars = 2083; // spec: file_url maxLength
|
|
// Our own caps.
|
|
static constexpr std::size_t kMaxMessages = 4096;
|
|
static constexpr std::size_t kMaxTools = 128;
|
|
static constexpr std::size_t kMaxStopSequences = 16;
|
|
static constexpr int kMaxChoices = 16; // n
|
|
static constexpr int kMaxTopLogprobs = 20;
|
|
static constexpr std::size_t kMaxStreamEvents = 200000;
|
|
static constexpr std::size_t kMaxModelChars = 160; // fine-tuned ids are long
|
|
static constexpr std::size_t kMaxEmbeddingInputs = 512;
|
|
static constexpr std::size_t kMaxEmbeddingChars = 1u << 20; // per input
|
|
static constexpr std::size_t kMaxModerationInputs = 256;
|
|
static constexpr std::size_t kMaxClassifyInputs = 256;
|
|
static constexpr std::size_t kMaxUploadBytes = 512u * 1024u * 1024u; // Files API (docs: 512 MB)
|
|
static constexpr std::size_t kMaxAudioBytes = 128u * 1024u * 1024u;
|
|
static constexpr std::size_t kMaxOcrPages = 1000;
|
|
static constexpr std::size_t kMaxFilenameBytes = 512;
|
|
static constexpr int kPageSizeMax = 100;
|
|
static constexpr std::size_t kMaxWalkPages = 20; // list walks
|
|
static constexpr std::size_t kMaxItemsReturned = 5000;
|
|
static constexpr std::size_t kMaxModelsReturned = 1024;
|
|
static constexpr int kSignedUrlExpiryMaxHours = 168;
|
|
static constexpr std::size_t kMaxIdChars = 256;
|
|
static constexpr std::size_t kMaxBodyFields = 64; // generic Operations
|
|
static constexpr std::size_t kMaxToolRounds = 16;
|
|
static constexpr std::size_t kMaxMetadataBytes = 16u * 1024u;
|
|
};
|
|
|
|
} // namespace molo::mistral
|