image strugles

This commit is contained in:
IGNY8 VPS (Salman)
2026-01-10 11:54:18 +00:00
parent 622e66b0fb
commit 1246f8ac5d
3 changed files with 8 additions and 6 deletions

View File

@@ -118,9 +118,9 @@ class ModelRegistry:
# Handle AIModelConfig instance
if rate_type == 'input':
return model.input_cost_per_1m or Decimal('0')
return model.cost_per_1k_input or Decimal('0')
elif rate_type == 'output':
return model.output_cost_per_1m or Decimal('0')
return model.cost_per_1k_output or Decimal('0')
elif rate_type == 'image':
return model.cost_per_image or Decimal('0')

View File

@@ -287,7 +287,9 @@ class AIModelConfigSerializer(serializers.Serializer):
def get_pricing_display(self, obj):
"""Generate pricing display string based on model type"""
if obj.model_type == 'text':
return f"${obj.input_cost_per_1m}/{obj.output_cost_per_1m} per 1M"
input_cost = obj.cost_per_1k_input or 0
output_cost = obj.cost_per_1k_output or 0
return f"${input_cost}/{output_cost} per 1K tokens"
elif obj.model_type == 'image':
return f"${obj.cost_per_image} per image"
return ""

View File

@@ -276,7 +276,7 @@ const CurrentProcessingCard: React.FC<CurrentProcessingCardProps> = ({
<Button
onClick={handlePause}
disabled={isPausing}
variant="outline"
variant="primary"
tone="warning"
size="sm"
startIcon={<PauseIcon className="w-4 h-4" />}
@@ -299,8 +299,8 @@ const CurrentProcessingCard: React.FC<CurrentProcessingCardProps> = ({
<Button
onClick={handleCancel}
disabled={isCancelling}
variant="ghost"
tone="neutral"
variant="primary"
tone="danger"
size="sm"
>
{isCancelling ? 'Cancelling...' : 'Cancel'}