AI Development

Simplified AI Development

Quickly set up a dedicated AI environment and tools within your internal infrastructure to kickstart development.

ai-project:mainai-assistant
Node.js example
Node.js example
43 seconds ago·dashboard
2025.01.30 (Thu)

Write a simple Node.js example.

dashboard·46 seconds ago

Certainly! Here is a simple example of a Node.js application that creates a basic web server using the http module:

// Import the http module
const http = require('http');

// Define the hostname and port the server will listen on
const hostname = '127.0.0.1';
const port = 3000;

// Create a server that responds with a "Hello, World!" message
const server = http.createServer((req, res) => {
  // Set the response header
  res.statusCode = 200; // Indicates a successful response
  res.setHeader('Content-Type', 'text/plain');
  
  // Send the response body
  res.end('Hello, World!\n');
});

// Make the server listen for incoming requests
server.listen(port, hostname, () => {
  console.log(`Server running at http://${hostname}:${port}/`);
});
  1. Run the server using Node.js by executing:

    node server.js
    
just now·gpt-4o· 1,113 Tokens

Tools

Quickly Set Up AI Tools

Easily configure and deploy the essential AI tools for your workflow. Get started quickly without the hassle of manual setup.

ESC
AI ChatBot - Discord

AI ChatBot - Discord Deploy the service

Service Name

Project

dev
H
project project
ESC
Chroma

Chroma Deploy the service

Service Name

Project

dev
H
project project
ESC
AI ChatBot - Slack

AI ChatBot - Slack Deploy the service

Service Name

Project

dev
H
project project
ESC
n8n

n8n Deploy the service

Service Name

Project

dev
H
project project
ESC
Ollama

Ollama Deploy the service

Service Name

Project

dev
H
project project
ESC
Flowise

Flowise Deploy the service

Service Name

Project

dev
H
project project
ESC
Jupyter Notebook

Jupyter Notebook Deploy the service

Service Name

Project

dev
H
project project
ESC
Qdrant

Qdrant Deploy the service

Service Name

Project

dev
H
project project
ESC
Chroma

Chroma Deploy the service

Service Name

Project

dev
H
project project

RAG

Simpler RAG

Simplify file and document integration, connect dynamic data sources, and enhance AI responses with ease—no complex configuration required.

example icon
Add Knowledge Base
ESC
FileURLDatabase
Drag & Drop your file here
Choose file

Supported format: pdf, doc, csv, xls, txt

file.pdf
920 KB
Apply

Customize

Customize AI with Plugin

AI can also be extended with plugins, allowing you to add models or integrate new middleware.

Custom Model

Add Custom Model

Integrate custom AI models seamlessly into your workflow. Deploy them effortlessly within your platform.

 
import { Model, RunResult, IThread, Ask } from '@ale-run/ai-sdk';

export class CustomModel extends Model {
  constructor(options: AnyObject) {
    super(options);
  }

  public async run(thread: IThread, ask: Ask): Promise<RunResult> {
    if (!thread) throw new Error(`argument thread is required`);
    if (!ask) throw new Error(`argument ask is required`);
    if (!ask.prompt) throw new Error(`argument ask.prompt is required`);

    const { model, instructions, prompt, files, temperature, maxPromptTokens, maxCompletionTokens, topP } = ask;
  }
}

AI SDK

Compatible with AI SDK

Accelerate frontend development with seamless Vercel AI SDK compatibility.

 
import { createAleAI } from '@ale-run/ai';
import { generateText } from 'ai';

const aleai = createAleAI({
  endpoint: 'https://your.domain/api/ai',
  apiKey: process.env.ALE_AI_API_KEY
});

const { text } = await generateText({
  model: aleai('gpt-4o'),
  prompt: 'Explain the concept of microservices in simple terms.',
});

console.log(text);