freedom-intelligence/scripts/reserve_progress.py
tegwick 8a65297d56 Stream model reserve to Scaleway without local weight staging
Assistant: codex
Assistant-Model: gpt-6-astra
Assistant-Session: 01a09cbd-43c1-79f3-809e-1ee97b40b64d
2026-09-14 00:17:15 +02:00

24 lines
1.3 KiB
Python

"""Read-only progress for the pinned V4-Flash collection; no credential output."""
import json
from stream_model import client, optional_json
s3 = client('https://s3.nl-ams.scw.cloud', 'nl-ams')
bucket = 'railiance-fi-open-weight-reserve'
identity = 'deepseek-ai__DeepSeek-V4-Flash-0731/7872f01b1d1fe23eabc4c98b48bffcef5a386062'
prefix = f'strategic/{identity}/'
objects = []
for page in s3.get_paginator('list_objects_v2').paginate(Bucket=bucket, Prefix=prefix):
objects.extend(page.get('Contents', []))
manifest = optional_json(s3, bucket, f'manifests/{identity}/MANIFEST.json')
active = []
for page in s3.get_paginator('list_multipart_uploads').paginate(Bucket=bucket, Prefix=prefix):
for upload in page.get('Uploads', []):
size = 0
for parts in s3.get_paginator('list_parts').paginate(
Bucket=bucket, Key=upload['Key'], UploadId=upload['UploadId']):
size += sum(p['Size'] for p in parts.get('Parts', []))
active.append({'key': upload['Key'], 'uploaded_part_bytes': size})
print(json.dumps({'completed_objects': len(objects), 'object_bytes': sum(o['Size'] for o in objects),
'complete_manifest': bool(manifest and manifest.get('complete')),
'active_uploads': active}, indent=2))