v4 Schritt 1: optimale Kontextfenster automatisch ermitteln
- hw_math: max_ctx_for() (Umkehrung der ctx-Heuristik) + extract_params_b + recommend_ctx. - cookbook.py: optimal_ctx pro Datei in analyze + evaluate. - models.py status: params_b + optimal_ctx pro Modell (psutil-RAM). - models.js Konfig-Modal: Empfehlung + 'Optimal uebernehmen'. - cookbook.js Modal: 'Empfohlener Kontext ... uebernehmen'. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+3
-1
@@ -9,7 +9,7 @@ from pydantic import BaseModel
|
||||
import psutil
|
||||
|
||||
from auth import auth
|
||||
from hw_math import evaluate_fit
|
||||
from hw_math import evaluate_fit, max_ctx_for
|
||||
|
||||
router = APIRouter(prefix="/api/cookbook", dependencies=[Depends(auth)])
|
||||
|
||||
@@ -79,6 +79,7 @@ async def analyze_repo(req: AnalyzeRequest):
|
||||
"filename": f,
|
||||
"quant": quant,
|
||||
"fit": fit,
|
||||
"optimal_ctx": max_ctx_for(params_b, quant, ram_gb),
|
||||
"priority": priority
|
||||
})
|
||||
|
||||
@@ -96,5 +97,6 @@ async def analyze_repo(req: AnalyzeRequest):
|
||||
def evaluate_single(req: EvaluateRequest):
|
||||
ram_gb = psutil.virtual_memory().total / (1024**3)
|
||||
fit = evaluate_fit(req.params_b, req.quant, req.ctx, ram_gb)
|
||||
fit["optimal_ctx"] = max_ctx_for(req.params_b, req.quant, ram_gb)
|
||||
return fit
|
||||
|
||||
|
||||
Reference in New Issue
Block a user