ask-my-llm
v1.1.5
Published
Oversimplified AI usage npm module
Downloads
575
Readme
ask-my-llm
Oversimplified AI usage npm module.
Install
npm install ask-my-llmConfigure
npx ask-my-llmPrompts for:
- Base API - OpenAI compatible endpoint (e.g.,
https://api.openai.com/v1) - API Key - Your API key (can be empty)
- Model - Model name (e.g.,
gpt-3.5-turbo)
Config saved to ~/.askairc.
TL;DR
const { ask, askAsync, getModel } = require("ask-my-llm");
// sync
const response = ask("Hello");
console.log(response);
// async
askAsync("Hello").then(console.log);
//misc
console.log(getModel()) // Returns currently used model e.g. `google/gemma-3-4b-it`API
ask(prompt: string): string
Sends a prompt to the configured AI and returns the response synchronously.
prompt- The message to send- Returns: AI response as string
askAsync(prompt: string): Promise
Sends a prompt to the configured AI and returns a Promise.
prompt- The message to send- Returns: Promise that resolves to AI response as string
getModel(): string
Gets current model used.
- Returns: raw model string.
