lucataco's picture
Clairic Flash, MLX 4-bit, with runtime, server and conversion script
ae97c5d verified
Raw History Blame Contribute Delete
860 Bytes
"""Configuration for a local Clairic model instance."""
from __future__ import annotations
from dataclasses import dataclass
DEFAULT_MAX_LENGTH = 65_273
MAX_PASS_TOKENS = 65_536
@dataclass(frozen=True, slots=True)
class RuntimeSettings:
model_path: str
model_id: str = "clairic-flash"
max_length: int = DEFAULT_MAX_LENGTH
max_concurrency: int = 1
version: str = "1"
model_aliases: tuple[str, ...] = ()
def __post_init__(self) -> None:
if (
type(self.max_length) is not int
or not 0 < self.max_length <= DEFAULT_MAX_LENGTH
):
raise ValueError(
f"max_length must be an integer from 1 to {DEFAULT_MAX_LENGTH}"
)
if type(self.max_concurrency) is not int or self.max_concurrency != 1:
raise ValueError("max_concurrency must be 1")