> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hardwave.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Premium Components

> Use high-fidelity cloud-served components in your Hardwave simulations

Premium components are high-fidelity models served from the Hardwave cloud. They integrate into your simulation graph exactly like stdlib components (same port and parameter API, same graph wiring, same engine), but the solver runs on Hardwave servers.

Use premium components for complex physics, proprietary lookup tables, or ML-based models without shipping proprietary code in your repository.

## Authentication

Authentication uses RSA-SHA256 signatures. The Hardwave dashboard generates a 2048-bit RSA key pair for your organization and gives you the **private key** (PEM). Your public key is stored server-side. Every API call is signed with your private key. Your private key is never sent over the wire and is never stored on Hardwave servers.

## Setup

<Steps>
  <Step title="Get your credentials">
    Open the [Hardwave dashboard](https://hardwave.dev) and copy your organization ID and private key PEM.
  </Step>

  <Step title="Configure and sync">
    Register premium components in the global `ComponentRegistry`.
  </Step>

  <Step title="Use like stdlib">
    Add premium components to any `SimulationGraph` and run normally.
  </Step>
</Steps>

### Configure in code

```python theme={null}
import hardwave
import hardwave.stdlib
import hardwave.premium

# Load the PEM from a file; never commit it to source control
private_key = open("hardwave_private.pem").read()

hardwave.premium.configure(
    organization_id="<your-org-uuid>",
    secret_key=private_key,
)
count = hardwave.premium.sync()
print(f"Registered {count} premium components")
```

### Configure with environment variables

```bash theme={null}
export HARDWAVE_ORGANIZATION_ID="<your-org-uuid>"
export HARDWAVE_SECRET_KEY="$(cat hardwave_private.pem)"
```

```python theme={null}
hardwave.premium.configure()  # reads from env automatically
hardwave.premium.sync()
```

Optional: set `HARDWAVE_SERVER_URL` to override the default server URL (`https://hardwave.dev`).

## Using premium components

Once `sync()` has run, premium components are in `ComponentRegistry` and behave identically to stdlib components:

```python theme={null}
from hardwave.components import ComponentRegistry
from hardwave.simulation import SimulationGraph, SimulationEngine

ThermalModel = ComponentRegistry.instance().get("AdvancedThermalModel")

graph = SimulationGraph()
graph.add_component(ThermalModel("mosfet_thermal", param_values={
    "thermal_resistance_jc": 3.2,
    "thermal_resistance_ca": 15.0,
}))
engine = SimulationEngine(graph)
result = engine.run(inputs={
    "mosfet_thermal": {"power_dissipation": 4.5, "ambient_temp": 35.0},
})
print(result.get_output("mosfet_thermal", "junction_temp"))
```

When the engine calls `solve()` on a premium component, it transparently dispatches to the Hardwave server. Your private key signs each request and simulation results come back exactly as if the solver ran locally.

## Hosted ML models

You can also create org-owned ML models, append training records, and train versioned solvers in the cloud. See [Hosted ML models](/reference/ml-models).

## Available premium components

<CardGroup cols={2}>
  <Card title="Advanced Thermal Model" icon="temperature-high" href="/premium/advanced-thermal-model">
    Multi-mode junction-to-ambient heat transfer for power semiconductors
  </Card>
</CardGroup>

## Error handling

| Exception                   | Cause                                    |
| --------------------------- | ---------------------------------------- |
| `PremiumNotConfiguredError` | `configure()` not called before `sync()` |
| `PremiumAuthError`          | Server rejected your credentials         |
| `PremiumSyncError`          | Component manifest could not be fetched  |
| `PremiumSolveError`         | Remote solve request failed              |

See [Error Handling](/reference/errors) for the full exception hierarchy.

<Warning>
  Never commit your private key PEM to version control. Load it from a file or environment variable.
</Warning>
