| from pydantic import BaseModel, Field |
| from typing import Optional, Literal, Dict, Any |
|
|
|
|
| BackendType = Literal["hf_inference_api", "local_transformers"] |
|
|
|
|
| class ModelSpec(BaseModel): |
| model_id: str = Field(..., description="HF model id, e.g. meta-llama/Meta-Llama-3-8B-Instruct") |
| backend: BackendType = "hf_inference_api" |
| temperature: float = 0.2 |
| max_new_tokens: int = 600 |
| top_p: float = 0.95 |
| repetition_penalty: float = 1.05 |
| system_prompt: Optional[str] = None |
| extra: Dict[str, Any] = Field(default_factory=dict) |
|
|
|
|
| class RunConfig(BaseModel): |
| analyzer: ModelSpec |
| refactor: ModelSpec |
| critic: ModelSpec |