LFM2-MoE-WebGPU / src /hooks /useLLM.ts
mlabonne's picture
Add demo files (#1)
4755edd
raw
history blame contribute delete
273 Bytes
import { useContext } from "react";
import { LLMContext, type LLMContextValue } from "./LLMContext";
export function useLLM(): LLMContextValue {
const ctx = useContext(LLMContext);
if (!ctx) throw new Error("useLLM must be used within <LLMProvider>");
return ctx;
}