Liz requires Node.js 18+ and either SQLite or PostgreSQL for the database. For development, SQLite is recommended as it requires no additional setup. For production, PostgreSQL is recommended for better scalability.
Make sure you've copied .env.example to .env and filled in all required variables:
Update your DATABASE_URL in .env and modify prisma/schema.prisma:
// prisma/schema.prisma
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
Then run prisma migrate to update your database:
npm run prisma:migrate
Yes, Liz supports both OpenAI and OpenRouter APIs. OpenRouter gives you access to models from Anthropic, Google, and others. You can specify the model when calling LLMUtils methods:
// OpenAI GPT-4
await llmUtils.getTextFromLLM(prompt, "openai/gpt-4");
// Anthropic Claude
await llmUtils.getTextFromLLM(prompt, "anthropic/claude-3-sonnet");
// Google PaLM
await llmUtils.getTextFromLLM(prompt, "google/palm-2");
Implement exponential backoff and retry logic in your routes:
async function withRetry(fn, maxRetries = 3) {
let retries = 0;
while (retries < maxRetries) {
try {
return await fn();
} catch (error) {
if (!error.message.includes('rate limit')) throw error;
retries++;
await new Promise(r =>
setTimeout(r, Math.pow(2, retries) * 1000)
);
}
}
throw new Error('Max retries exceeded');
}
Several strategies can help manage memory usage:
For high-traffic applications:
Common Twitter integration issues:
Use dryRun mode to test your bot without posting:
TWITTER_DRY_RUN=true
We welcome contributions! Here's how to get started:
Please follow our coding standards and include clear commit messages.