Skip to content

Oneseco-Media/cybersoulja

Repository files navigation

LMS Project

A Node.js client application for interacting with LM Studio's large language models locally. This project provides a simple interface to communicate with locally hosted language models through the LM Studio server.

Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (v14 or higher)
  • LM Studio desktop application
  • A compatible language model downloaded through LM Studio

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/lms-project.git
cd lms-project
  1. Install dependencies:
npm install

Configuration

Environment Setup

  1. Copy .env.example to .env:
cp .env.example .env
  1. Configure your environment variables:
SUPABASE_URL=your_supabase_project_url
SUPABASE_ANON_KEY=your_supabase_anon_key

Supabase Setup

  1. Sign up for a Supabase account at https://supabase.com
  2. Create a new project
  3. Copy your project URL and anon key to your .env file
  4. Initialize the Supabase client in your application

LM Studio Setup

  1. Start the LM Studio server:
lms server start
  1. In LM Studio desktop app:
  • Load your preferred language model
  • Ensure the server is running (default port: 1234)
  • Note the model path for configuration

Usage

  1. Run the application:
npm start
  1. Example code for interacting with the model:
import { LMStudioClient } from '@lmstudio/sdk';

const client = new LMStudioClient();

async function generateResponse(prompt) {
    const response = await client.complete({
    prompt,
    temperature: 0.7,
    maxTokens: 500
    });
    return response;
}
  1. Command-line interaction:
> Enter your prompt: What is artificial intelligence?
> AI: Artificial intelligence refers to the simulation of human intelligence...

Deployment

The application is deployed on Cloudflare Pages:

  • Production URL: https://supabase.oneseco.com
  • Automatic deployments from the main branch
  • Environment variables are configured in the Cloudflare dashboard

For detailed deployment instructions, see DEPLOY.md.

Development

The source code resides in the src/ directory. For development purposes:

  • Make changes to the source files
  • Run the project using npm start
  • Test your changes with different prompts and models

Resources & Community

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

My personal organization repo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published