Skip to main content
Glama

OpenXAI MCP Server

by Cappybara12
setup-openxai-studio.js•11 kB
#!/usr/bin/env node import { createInterface } from 'readline'; import fs from 'fs-extra'; import axios from 'axios'; class OpenXAIStudioSetup { constructor() { this.rl = createInterface({ input: process.stdin, output: process.stdout }); } async question(prompt) { return new Promise((resolve) => { this.rl.question(prompt, resolve); }); } async setup() { console.log('🌐 OpenXAI Studio Setup'); console.log('Decentralized AI Model Deployment'); console.log('===============================\n'); console.log('šŸ”— OpenXAI Studio revolutionizes AI deployment with:'); console.log(' āœ… Decentralized deployment (not controlled by single entity)'); console.log(' āœ… X nodes for distributed computation'); console.log(' āœ… Better cost rates and efficiency'); console.log(' āœ… Web3 wallet integration'); console.log(' āœ… Multiple model options\n'); try { // Step 1: Wallet setup const walletConfig = await this.setupWallet(); // Step 2: Model selection const modelConfig = await this.selectModel(); // Step 3: Resource configuration const resourceConfig = await this.configureResources(modelConfig); // Step 4: Subscription options const subscriptionConfig = await this.configureSubscription(); // Step 5: Save configuration await this.saveConfiguration(walletConfig, modelConfig, resourceConfig, subscriptionConfig); console.log('\nāœ… OpenXAI Studio setup completed!'); console.log('šŸš€ You can now deploy with `npm run deploy:openxai-studio`'); console.log('šŸ”— Connect your wallet with `npm run connect:wallet`'); } catch (error) { console.error('āŒ Setup failed:', error.message); } finally { this.rl.close(); } } async setupWallet() { console.log('šŸ’³ Web3 Wallet Configuration\n'); console.log('Choose your Web3 wallet:'); console.log('1. MetaMask'); console.log('2. WalletConnect'); console.log('3. Coinbase Wallet'); console.log('4. Trust Wallet'); console.log('5. Other'); const choice = await this.question('Enter your choice (1-5): '); const wallets = { '1': 'metamask', '2': 'walletconnect', '3': 'coinbase', '4': 'trust', '5': 'other' }; const walletType = wallets[choice] || 'metamask'; console.log(`\nšŸ“± Selected: ${walletType}`); console.log('ā„¹ļø Your wallet will be connected during deployment'); console.log('ā„¹ļø This enables decentralized access to OpenXAI Studio'); return { type: walletType, enabled: true }; } async selectModel() { console.log('\nšŸ¤– Model Selection\n'); console.log('Available models in OpenXAI Studio:'); console.log('1. DeepSeek R1 - Advanced reasoning model'); console.log('2. Code Llama - Meta\'s code generation model'); console.log('3. Gamma 2 - Google\'s latest model'); console.log('4. Llama 3.2 Vision - 90B parameter vision model'); console.log('5. Embedding Models - For text embeddings'); console.log('6. Code Models - Specialized for code generation'); const choice = await this.question('Enter your choice (1-6): '); const models = { '1': { name: 'deepseek-r1', displayName: 'DeepSeek R1', type: 'reasoning', parameters: ['1.5B', '7B', '32B'], description: 'Advanced reasoning model with strong analytical capabilities' }, '2': { name: 'code-llama', displayName: 'Code Llama', type: 'code', parameters: ['1.5B', '7B', '13B', '34B'], description: 'Meta\'s specialized code generation model' }, '3': { name: 'gamma-2', displayName: 'Gamma 2', type: 'general', parameters: ['1.5B', '7B', '13B'], description: 'Google\'s latest general-purpose model' }, '4': { name: 'llama-3.2-vision', displayName: 'Llama 3.2 Vision', type: 'vision', parameters: ['11B', '90B'], description: 'Vision-enabled model for image and text processing' }, '5': { name: 'embedding-model', displayName: 'Embedding Models', type: 'embedding', parameters: ['small', 'large'], description: 'Text embedding models for semantic search' }, '6': { name: 'code-model', displayName: 'Code Models', type: 'code', parameters: ['1.5B', '7B'], description: 'Specialized code generation and analysis' } }; const selectedModel = models[choice] || models['1']; console.log(`\nāœ… Selected: ${selectedModel.displayName}`); console.log(` Type: ${selectedModel.type}`); console.log(` Description: ${selectedModel.description}`); // Select parameter size console.log('\nAvailable parameter sizes:'); selectedModel.parameters.forEach((param, index) => { console.log(`${index + 1}. ${param}`); }); const paramChoice = await this.question('Choose parameter size: '); const paramSize = selectedModel.parameters[parseInt(paramChoice) - 1] || selectedModel.parameters[0]; console.log(`āœ… Parameter size: ${paramSize}`); return { ...selectedModel, parameterSize: paramSize }; } async configureResources(modelConfig) { console.log('\nāš™ļø Resource Configuration\n'); console.log('šŸ–„ļø X Node Deployment (Decentralized):'); console.log(' - Computation distributed across multiple nodes'); console.log(' - No single point of failure'); console.log(' - Cost-effective compared to centralized providers\n'); console.log('Resource options for', modelConfig.displayName); // RAM configuration console.log('RAM options:'); console.log('1. 8GB - Basic deployment'); console.log('2. 16GB - Recommended'); console.log('3. 32GB - High performance'); console.log('4. 64GB - Maximum performance'); const ramChoice = await this.question('Choose RAM (1-4): '); const ramOptions = ['8GB', '16GB', '32GB', '64GB']; const selectedRAM = ramOptions[parseInt(ramChoice) - 1] || '16GB'; // Storage configuration console.log('\nStorage options:'); console.log('1. 50GB - Basic'); console.log('2. 100GB - Recommended'); console.log('3. 200GB - Extended'); console.log('4. 500GB - Maximum'); const storageChoice = await this.question('Choose storage (1-4): '); const storageOptions = ['50GB', '100GB', '200GB', '500GB']; const selectedStorage = storageOptions[parseInt(storageChoice) - 1] || '100GB'; // CPU cores console.log('\nCPU cores:'); console.log('1. 2 cores - Basic'); console.log('2. 4 cores - Recommended'); console.log('3. 8 cores - High performance'); console.log('4. 16 cores - Maximum'); const cpuChoice = await this.question('Choose CPU cores (1-4): '); const cpuOptions = ['2', '4', '8', '16']; const selectedCPU = cpuOptions[parseInt(cpuChoice) - 1] || '4'; console.log('\nāœ… Resource configuration:'); console.log(` RAM: ${selectedRAM}`); console.log(` Storage: ${selectedStorage}`); console.log(` CPU Cores: ${selectedCPU}`); return { ram: selectedRAM, storage: selectedStorage, cpu: selectedCPU, xnode: true }; } async configureSubscription() { console.log('\nšŸ’³ Subscription Configuration\n'); console.log('OpenXAI Studio subscription options:'); console.log('1. Side Later - Pay later model'); console.log('2. ERC 4337 - Subscription service'); console.log('3. Model Ownership - Complete ownership and licensing'); console.log('4. Fractionalized AI - Shared ownership model'); const choice = await this.question('Choose subscription (1-4): '); const subscriptions = { '1': { type: 'side-later', name: 'Side Later', description: 'Pay-as-you-go model', features: ['No upfront cost', 'Pay per usage', 'Flexible scaling'] }, '2': { type: 'erc-4337', name: 'ERC 4337', description: 'Subscription service', features: ['Monthly subscription', 'Predictable costs', 'Premium support'] }, '3': { type: 'model-ownership', name: 'Model Ownership', description: 'Complete ownership and licensing', features: ['Full model control', 'Licensing rights', 'Commercial use'] }, '4': { type: 'fractionalized-ai', name: 'Fractionalized AI', description: 'Shared ownership model', features: ['Shared costs', 'Collaborative deployment', 'Community governance'] } }; const selectedSubscription = subscriptions[choice] || subscriptions['1']; console.log(`\nāœ… Selected: ${selectedSubscription.name}`); console.log(` Description: ${selectedSubscription.description}`); console.log(' Features:'); selectedSubscription.features.forEach(feature => { console.log(` - ${feature}`); }); return selectedSubscription; } async saveConfiguration(walletConfig, modelConfig, resourceConfig, subscriptionConfig) { const config = { openxai_studio: { wallet: walletConfig, model: modelConfig, resources: resourceConfig, subscription: subscriptionConfig, deployment: { type: 'decentralized', platform: 'openxai-studio', xnode: true } }, setup: { timestamp: new Date().toISOString(), version: '1.0.0' } }; await fs.ensureDir('config'); await fs.writeJSON('config/openxai-studio.json', config, { spaces: 2 }); // Create environment file const envContent = ` # OpenXAI Studio Configuration OPENXAI_STUDIO_ENABLED=true OPENXAI_WALLET_TYPE=${walletConfig.type} OPENXAI_MODEL=${modelConfig.name} OPENXAI_PARAMETER_SIZE=${modelConfig.parameterSize} OPENXAI_RAM=${resourceConfig.ram} OPENXAI_STORAGE=${resourceConfig.storage} OPENXAI_CPU=${resourceConfig.cpu} OPENXAI_SUBSCRIPTION=${subscriptionConfig.type} OPENXAI_XNODE=true OPENXAI_DECENTRALIZED=true `; await fs.writeFile('.env.openxai-studio', envContent.trim()); console.log('\nšŸ’¾ Configuration saved to config/openxai-studio.json'); console.log('šŸ”’ Environment variables saved to .env.openxai-studio'); } } // Run the setup const setup = new OpenXAIStudioSetup(); setup.setup().catch(console.error);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Cappybara12/mcpopenxAI'

If you have feedback or need assistance with the MCP directory API, please join our Discord server