mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2024-12-21 05:13:10 +00:00
863 B
863 B
LollmsClient Quick Start
-
Initialize:
const client = new LollmsClient('http://localhost:9600', <(optional) model name>);
-
Generate Text:
const response = await client.generateText("Write a short story."); console.log(response);
-
Tokenize/Detokenize:
const tokens = await client.tokenize("Hello, world!"); // the tokens are a list of a list, the first entry is the token text and the second is the token id // Extract only the token IDs from the tokenized result const tokenIds = tokens.map(token => token[1]); // Use the token IDs for detokenization const text = await client.detokenize(tokenIds);
-
List Resources:
const personalities = await client.listMountedPersonalities(); const models = await client.listModels();