|
1 | 1 | """Main Client class that unifies all OpenGradient service namespaces.""" |
2 | 2 |
|
3 | | -import logging |
4 | 3 | from typing import Optional |
5 | 4 |
|
6 | 5 | from web3 import Web3 |
|
14 | 13 | from .alpha import Alpha |
15 | 14 | from .llm import LLM |
16 | 15 | from .model_hub import ModelHub |
17 | | -from .tee_registry import TEERegistry |
18 | 16 | from .twins import Twins |
19 | 17 |
|
20 | | -logger = logging.getLogger(__name__) |
21 | | - |
22 | 18 |
|
23 | 19 | class Client: |
24 | 20 | """ |
@@ -113,42 +109,15 @@ def __init__( |
113 | 109 | if email is not None: |
114 | 110 | hub_user = ModelHub._login_to_hub(email, password) |
115 | 111 |
|
116 | | - # Resolve LLM server URL and TLS certificate. |
117 | | - # If the caller provided explicit URLs, use those with standard CA verification. |
118 | | - # Otherwise, discover the endpoint and registry-verified cert from the TEE Registry. |
119 | | - llm_tls_cert_der: Optional[bytes] = None |
120 | | - tee = None |
121 | | - if og_llm_server_url is None: |
122 | | - try: |
123 | | - registry = TEERegistry( |
124 | | - rpc_url=rpc_url, |
125 | | - registry_address=tee_registry_address, |
126 | | - ) |
127 | | - tee = registry.get_llm_tee() |
128 | | - if tee is not None: |
129 | | - og_llm_server_url = tee.endpoint |
130 | | - llm_tls_cert_der = tee.tls_cert_der |
131 | | - logger.info("Using TEE endpoint from registry: %s (teeId=%s)", tee.endpoint, tee.tee_id) |
132 | | - else: |
133 | | - raise ValueError("No active LLM proxy TEE found in the registry. Pass og_llm_server_url explicitly to override.") |
134 | | - except ValueError: |
135 | | - raise |
136 | | - except Exception as e: |
137 | | - raise RuntimeError( |
138 | | - f"Failed to fetch LLM TEE endpoint from registry ({tee_registry_address} on {rpc_url}): {e}. " |
139 | | - "Pass og_llm_server_url explicitly to override." |
140 | | - ) from e |
141 | | - |
142 | 112 | # Create namespaces |
143 | 113 | self.model_hub = ModelHub(hub_user=hub_user) |
144 | 114 | self.wallet_address = wallet_account.address |
145 | 115 |
|
146 | 116 | self.llm = LLM( |
147 | 117 | wallet_account=wallet_account, |
148 | 118 | og_llm_server_url=og_llm_server_url, |
149 | | - tls_cert_der=llm_tls_cert_der, |
150 | | - tee_id=tee.tee_id if tee is not None else None, |
151 | | - tee_payment_address=tee.payment_address if tee is not None else None, |
| 119 | + rpc_url=rpc_url, |
| 120 | + tee_registry_address=tee_registry_address, |
152 | 121 | ) |
153 | 122 |
|
154 | 123 | self.alpha = Alpha( |
|
0 commit comments