Flash Queries

Every inference engine today is passive. You send a question, it computes an answer, it sends it back. Flash Queries makes the model proactive. Define your questions upfront. The server evaluates them after every data update and pushes answers to your client via SSE.

Flash Queries is a fundamentally new interaction pattern for transformer-based inference. The model is no longer waiting for your question. It is already working on the answer.

"Is momentum accelerating or decelerating?"
"Is volatility expanding or contracting?"
"Is price near support or resistance?"
"Is volume confirming the trend?"
"Is a reversal likely?"
"Is the move confirmed?"
flash-queries
import { LayerScale } from '@layerscale/layerscale';

const client = new LayerScale('http://127.0.0.1:8080', {
    apiKey: 'your-api-key',
});

// Create session with flash queries
const session = await client.createSession({
    prompt: 'You are a quantitative trading strategist '
    + 'analyzing live market microstructure.',
    flash: [
        'Is momentum accelerating or decelerating?',
        'Is volatility expanding or contracting?',
        'Is price near support or resistance?',
        'Is volume confirming the trend?',
        'Is a reversal likely?',
    ],
});

// Push price data
await client.streamPush(session.session_id, [{
    ts: Math.floor(Date.now() / 1000),
    sym: 'AAPL',
    o: 150.25, h: 151.00, l: 149.80, c: 150.90, v: 100000,
}]);

// Answers arrive automatically via SSE
for await (const event of client.events(session.session_id)) {
    if (event.type === 'flash_ready') {
        console.log(event.answer, event.confidence);
    }
}
from layerscale import LayerScale

client = LayerScale("http://127.0.0.1:8080", api_key="your-api-key")

# Create session with flash queries
session = client.create_session(
    prompt="You are a quantitative trading strategist "
    "analyzing live market microstructure.",
    flash=[
        "Is momentum accelerating or decelerating?",
        "Is volatility expanding or contracting?",
        "Is price near support or resistance?",
        "Is volume confirming the trend?",
        "Is a reversal likely?",
    ],
)

# Push price data
client.stream_push(session.session_id, [{
    "ts": int(time()),
    "sym": "AAPL",
    "o": 150.25, "h": 151.00, "l": 149.80, "c": 150.90, "v": 100000,
}])

# Answers arrive automatically via SSE
for event in client.events(session.session_id):
    if event.type == "flash_ready":
        print(event.answer, event.confidence)

See Flash Queries
in Action

If you're at a hedge fund or financial institution and want to see a live demo, book a call with us.