Quick Start Tutorial
Send your first AI request in under 5 minutes
1. Start the Server
cd Beep.AI.Server/Beep.AI.Server
python run.py
The server starts at http://localhost:5000. On first run, complete the Setup Wizard to initialize the database and create an admin account.
2. Install an LLM Model
Navigate to LLM in the admin panel and download a model, or use the API:
curl -X POST http://localhost:5000/api/v1/llm/models/download \
-H "Content-Type: application/json" \
-d '{"model_id": "microsoft/phi-2"}'
3. Make Your First Chat Request
curl -X POST http://localhost:5000/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"model": "phi-2",
"messages": [
{"role": "user", "content": "Hello! What can you do?"}
]
}'
4. Try RAG (Retrieval-Augmented Generation)
Create a RAG Collection
curl -X POST http://localhost:5000/v1/rag/collections \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"name": "my-docs",
"provider": "faiss",
"embedding_model": "all-MiniLM-L6-v2"
}'
Query the Collection
curl -X POST http://localhost:5000/v1/rag/query \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"collection_id": "my-docs",
"query": "What is retrieval augmented generation?",
"top_k": 5
}'
5. Use a Client SDK
Python
from beep_ai_sdk import BeepClient
client = BeepClient(base_url="http://localhost:5000", api_key="YOUR_API_TOKEN")
response = client.chat.completions.create(
model="phi-2",
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)
JavaScript
import { BeepClient } from '@beep-ai/sdk';
const client = new BeepClient({
baseURL: 'http://localhost:5000',
apiKey: 'YOUR_API_TOKEN'
});
const response = await client.chat.completions.create({
model: 'phi-2',
messages: [{ role: 'user', content: 'Hello!' }]
});
console.log(response.choices[0].message.content);