Repository navigation
v0.1.8
What's New in 0.1.8
Built-in AI Toolkit (malia.ai)
Zero-config AI integration. Auto-detects local LLMs and cloud providers. No npm packages.
// One-liner — auto-detects Ollama, vLLM, LM Studio
const reply = await malia.ai("What is quantum computing?");
// Frontier models — infers provider from model name
const ai = malia.ai("gpt-4o"); // OPENAI_API_KEY
const ai = malia.ai("claude-sonnet-4-20250514"); // ANTHROPIC_API_KEY
const ai = malia.ai("gemini-2.0-flash"); // GOOGLE_API_KEY
const ai = malia.ai("grok-3"); // XAI_API_KEY
// Streaming
for await (const token of ai.stream("Explain gravity")) {
process.stdout.write(token);
}
// Embeddings + similarity
const vec = await ai.embed("search query");
const score = malia.ai.similarity(vecA, vecB);Supported: OpenAI, Anthropic (native Messages API), Google Gemini (native generateContent API), Mistral, Groq, DeepSeek, Together, Fireworks, Perplexity, xAI, plus all local OpenAI-compatible endpoints.
Hot Module Replacement
Zero-downtime code swaps on a running server. No restart, no port rebind, no dropped connections.
const server = jse.serve({ port: 3000 }, handler);
await server.hot("./handler.mjs"); // watches file, reloads on change
server.reload(newHandler); // programmatic swapThe HTTP socket stays open. In-flight requests finish with the old handler. New requests use the new handler immediately.
HTTP Connection Pooling
http.Agent({ keepAlive: true }) reuses TCP sockets across requests.
Request Body Streaming
Bodies > 10 MB stream through a channel instead of buffering in memory.
OpenTelemetry Auto-Instrumentation
jse.trace.autoInstrument(); // trace all fetch() calls
jse.serve({ port: 3000 }, jse.trace.instrumentedHandler(handler));Configurable Serve Limits
No arbitrary caps. handlerTimeout, handlerTimeoutMs, and timeout accepted as aliases.
jse.serve({ limits: { requestTimeoutMs: 600000, maxBodyBytes: 100 * 1024 * 1024 } }, handler);80+ Bug Fixes
Security: HTTP response header injection (CRLF) blocked in ServerResponse.setHeader
Node.js Compatibility: IncomingMessage close event, async iterator body, createServer(options, listener), _implicitHeader/headersSent, GET/HEAD no Content-Length, proper error codes (408/413/502/504), server.address(), Buffer.from validation, Buffer.write UTF-8 safety, Response.clone() WHATWG spec, and many more.
Performance: Hex encode lookup table, latin1/ascii batched decode, Buffer.concat fast path, Response.json skip Headers allocation, serve hot path inlined, randomUUID inline nibble lookup.
Compatibility
243/243 Node.js API surface checks pass (100%).
Full Changelog: v0.1.7...v0.1.8