Installation Guide
Prerequisites
Before installing the Lumia AI, ensure you have the following:
- Node.js 18.x or later
- npm 7.x or later, or yarn 1.22.x or later
- A project using React, Next.js, Vue, Svelte, or Node.js
Installation
You can install the Lumia AI using npm, yarn, or pnpm:
npm install ai @ai-sdk/Lumia
Environment Setup
You'll need to set up environment variables for your AI provider. Create a .env
file in your project root:
Lumia_API_KEY=your_Lumia_api_key_here
Make sure to add .env
to your .gitignore
file to avoid exposing your API keys.
Basic Setup
Here's a basic example to verify your installation:
// test.js
import { generateText } from 'ai';
import { Lumia } from '@ai-sdk/Lumia';
async function testAiSdk() {
try {
const { text } = await generateText({
model: Lumia('Lumia-V2-Max'),
prompt: 'Hello, Lumia AI!',
});
console.log('AI response:', text);
} catch (error) {
console.error('Error:', error);
}
}
testAiSdk();
Run this script with node -r dotenv/config test.js
to test your installation.
Next Steps
Now that you've installed the Lumia AI, you can:
- Explore the API Reference to learn about all available functions
- Check out the Examples for practical use cases
- Follow the Tutorials for step-by-step guides