Generate per-session LoRA adapters for inference tasks
Project description
Tessera Hypernetwork
Generate per-session LoRA adapters for inference tasks using hypernetwork synthesis.
Features
- Metadata-to-LoRA: Generate adapters from structured user metadata (JSON)
- Text-to-LoRA: Generate adapters from natural language descriptions
- Doc-to-LoRA with SHINE: Generate adapters from document content using SHINE (ICML 2026) for long-context internalization
- FastAPI: Modern async Python web framework
- OpenAI-compatible API: Easy integration with existing tooling
Installation
pip install tessera-hypernetwork
Quick Start
Generate LoRA Adapter from Metadata
tessera generate \
--from-metadata '{"task": "classification", "domain": "medical"}' \
--save ./adapter.safetensors
The --base-model argument is optional and defaults to mistralai/Mistral-7B-Instruct-v0.2.
Generate LoRA Adapter from Text Description
tessera generate \
--from-text "Senior litigation associate specializing in IP law" \
--save ./adapter.safetensors
Generate LoRA Adapter from Document
tessera generate \
--from-doc ./document.txt \
--save ./adapter.safetensors
Start the Hypernetwork Server
tessera serve --port 8000 --host 0.0.0.0
Check Server Health
tessera health --url http://localhost:8000
List Available Base Models
tessera list
CLI Commands
Generate
Generate LoRA adapters from metadata, text, or documents:
# From metadata (JSON string or file)
tessera generate \
--from-metadata '{"task": "classification", "domain": "medical"}' \
--base-model mistralai/Mistral-7B-Instruct-v0.2 \
--rank 16 \
--save ./adapter.safetensors
# From text description
tessera generate \
--from-text "Medical diagnosis assistant" \
--base-model mistralai/Mistral-7B-Instruct-v0.2 \
--rank 16 \
--save ./adapter.safetensors
# From document
tessera generate \
--from-doc ./document.txt \
--base-model mistralai/Mistral-7B-Instruct-v0.2 \
--rank 16 \
--save ./adapter.safetensors
Options:
--from-metadata: JSON metadata string or file path--from-text: Natural language description--from-doc: Document content or file path--base-model: Base model identifier (default: mistralai/Mistral-7B-Instruct-v0.2)--rank: LoRA rank (default: 16)--save: Output path for safetensors file (required)--mode: Generation mode: doc, metadata, or text (auto-inferred if not specified)
Serve
Start the hypernetwork server:
tessera serve --port 8000 --host 0.0.0.0
Options:
--port: Port to serve on (default: 8000)--host: Host to bind to (default: 0.0.0.0)--qdrant-url: Qdrant vector database URL (optional)--workers: Number of worker processes (default: 1)
Health
Check server health status:
tessera health --url http://localhost:8000
Options:
--url: Server URL (default: http://localhost:8000)
List
List available base models and their dimensions:
tessera list
LoRAX Adapter Management
Import, list, and unload adapters:
# Import an adapter
tessera lorax import-adapter \
--path ./adapter.safetensors \
--name my-adapter \
--base-model mistralai/Mistral-7B-Instruct-v0.2 \
--server-url http://localhost:8000
# List loaded adapters
tessera lorax list-adapters --server-url http://localhost:8000
# Unload an adapter
tessera lorax unload --name my-adapter --server-url http://localhost:8000
API Endpoints
The hypernetwork service provides a FastAPI server with the following endpoints:
POST /v1/generate- Generate a LoRA adapter for a given promptGET /health- Health check endpointPOST /v1/adapters- Import adapter safetensorsGET /v1/adapters- List loaded adaptersDELETE /v1/adapters/{name}- Unload adapter
Development
Install development dependencies:
pip install tessera-hypernetwork[dev]
Run tests:
pytest
Run linting:
ruff check .
License
Apache-2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tessera_hypernetwork-1.0.7.tar.gz.
File metadata
- Download URL: tessera_hypernetwork-1.0.7.tar.gz
- Upload date:
- Size: 45.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1dbb8364e553f7bdd5ccab88ec72dd73da4fc8c1168c53112a09dd8bdd6cf695
|
|
| MD5 |
b042f06919f5362562d439d054ec2765
|
|
| BLAKE2b-256 |
bf83d90bf282894f25dd52d652ad9e519e4afff948f38d969c9be4d24534072d
|
File details
Details for the file tessera_hypernetwork-1.0.7-py3-none-any.whl.
File metadata
- Download URL: tessera_hypernetwork-1.0.7-py3-none-any.whl
- Upload date:
- Size: 52.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a95a7a09261b274bfedb96c302189366f05e7adc8f2d2bec66392afa6739f602
|
|
| MD5 |
530177794a8779c68ae979030a38f7aa
|
|
| BLAKE2b-256 |
098261f0b8b974bb8e6df0f0a2a64d47b3d5eeefc2e596dfb5b9d2c8dd3c403f
|