embed_remote¶
Embed a spectrum via a remote HTTPS inference endpoint.
| Category | Embeddings |
| Backend | httpx - calls an external inference endpoint (optional extra embedding-remote) |
| Version | 1.0.1 |
| Reads | ctx.spectrum (a Spectrum1D) |
| Writes | embedding, extras.embedding_provenance, metrics.embedding_dim, metrics.embedding_norm |
The endpoint contract is documented in the module docstring. Any service that respects it (including a self-hosted spectro-kernel MCP cloud running embed_pretrained server-side) can be plugged in. The user is responsible for the endpoint URL and (optionally) an API key; the kernel doesn't ship any defaults.
Parameters¶
| Parameter | Default | Required | Description |
|---|---|---|---|
endpoint |
None |
yes | Full HTTPS URL of the inference endpoint (REQUIRED). |
model |
'default' |
- | Model identifier passed in the request body. |
api_key |
None |
- | Bearer token for the endpoint. Falls back to the SPECTRO_EMBED_API_KEY environment variable when null (on a shared server only for hosts listed in SPECTRO_EMBED_ENDPOINT_ALLOW). |
dim |
256 |
- | Requested output dimension (the server may ignore this hint). |
timeout_s |
30.0 |
- | HTTP request timeout in seconds (default 30). |
Use it¶
References¶
- MCP-style stateless inference endpoints — see e.g. HuggingFace Inference API, OpenAI embedding endpoints, Replicate.
Related algorithms¶
embed_band_power- Embed a spectrum as the integrated flux in N adjacent wavelength bands.embed_continuum_subtracted- Subtract the polynomial continuum, then embed the line residual.embed_lick_indices- Embed a spectrum as the canonical Lick/IDS line-strength indices.embed_log_lambda- Resample to a uniform log-λ grid, then embed.embed_pretrained- Embed a spectrum with a local pre-trained PyTorch model.embed_spectrum- Compute a fixed-length, L2-normalised embedding of a spectrum.embed_wavelets- Embed a spectrum via a truncated discrete wavelet transform.