Refactor GPU capabilities structure and add Ollama models to miner registration payload
Some checks failed
Coverage Phase 1 (70% Target) / test-coverage-70 (push) Has been cancelled
Coverage Phase 2 (85% Target) / test-coverage-85 (push) Has been cancelled
Cross-Node Transaction Testing / transaction-test (push) Has been cancelled
Deploy to Testnet / deploy-testnet (push) Has been cancelled
Integration Tests / test-service-integration (push) Has been cancelled
Multi-Node Stress Testing / stress-test (push) Has been cancelled
Python Tests / test-python (push) Has been cancelled
Security Scanning / security-scan (push) Has been cancelled

This commit is contained in:
aitbc
2026-05-27 12:04:13 +02:00
parent 0314e2da7c
commit 424a8b1f5a

View File

@@ -99,19 +99,27 @@ def build_gpu_capabilities() -> Dict:
arch = classify_architecture(model) if model else "unknown"
edge_optimized = arch in {"ada_lovelace", "ampere", "turing"}
# Get available Ollama models
ollama_available, models = check_ollama()
return {
"gpu": {
"model": model,
"gpus": [
{
"name": model,
"memory_mb": memory_total,
"architecture": arch,
"consumer_grade": True,
"edge_optimized": edge_optimized,
"memory_gb": memory_total,
"cuda_version": cuda_version,
"platform": "CUDA",
}
] if gpu_info else [],
"cuda": cuda_version,
"models": models if ollama_available else [],
"price": 0.01, # Default price per hour
"region": "localhost",
"platform": "CUDA" if gpu_info else "CPU",
"supported_tasks": ["inference", "training", "stable-diffusion", "llama"],
"max_concurrent_jobs": 1
}
}
def measure_coordinator_latency() -> float:
@@ -354,6 +362,7 @@ def submit_result(job_id, result):
"""Submit job result to coordinator"""
headers = {
"X-Api-Key": AUTH_TOKEN,
"X-Miner-ID": MINER_ID,
"Content-Type": "application/json"
}