File size: 826 Bytes
8ff63e4
 
 
 
 
 
7ed0b8b
8ff63e4
 
 
 
 
 
7ed0b8b
 
 
 
8ff63e4
 
 
 
7ed0b8b
8ff63e4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from __future__ import annotations

from typing import Literal

from pydantic import BaseModel

COLOSSEUM_MODELS_ROUTE = "/models"
COLOSSEUM_PROMPT_ROUTE = "/prompt"
COLOSSEUM_RESP_VOTE_ROUTE = "/response_vote"
COLOSSEUM_ENERGY_VOTE_ROUTE = "/energy_vote"
COLOSSEUM_HEALTH_ROUTE = "/health"


class ModelsResponse(BaseModel):
    available_models: list[str]


class PromptRequest(BaseModel):
    request_id: str
    prompt: str
    model_index: Literal[0, 1]
    model_preference: str


class ResponseVoteRequest(BaseModel):
    request_id: str
    victory_index: Literal[0, 1]


class ResponseVoteResponse(BaseModel):
    model_names: list[str]
    energy_consumptions: list[float]


class EnergyVoteRequest(BaseModel):
    request_id: str
    is_worth: bool


class EnergyVoteResponse(BaseModel):
    model_names: list[str]