Files
LlamaIndexTS/examples/llama3.ts
T
2025-02-10 15:43:29 +07:00

14 lines
371 B
TypeScript

import { ReplicateLLM } from "@llamaindex/replicate";
(async () => {
const tres = new ReplicateLLM({ model: "llama-3-70b-instruct" });
const stream = await tres.chat({
messages: [{ content: "Hello, world!", role: "user" }],
stream: true,
});
for await (const chunk of stream) {
process.stdout.write(chunk.delta);
}
console.log("\n\ndone");
})();