Skip to content

weise25/LocalSite-ai

Repository files navigation

What's new? See the Changelog for details.

Important

Security: A compromised build of ai-sdk-ollama@2.2.1 (supply-chain worm, 2026-06-04) could be pulled by the old ^2.2.0 range. The dependency is now pinned to the safe 2.2.0. If you installed this project on or after that date, see SECURITY.md to check and remediate.

Caution

v0.6.0 — Breaking changes: This release replaces the entire Next.js / React stack with SvelteKit + Svelte 5 and moves the runtime to Deno 2. Features and all 9 AI provider integrations are unchanged — only the toolchain and project structure differ.

If you are upgrading from v0.5.x or earlier:

  1. Install Deno 2.x — Node.js and npm are no longer required.
  2. Pull the latest code and run deno install (replaces npm install).
  3. Keep your existing .env.local (dev) or .env (production) — environment variable names are unchanged.
  4. Use deno task dev, deno task build, and deno task start instead of npm scripts.
  5. For Docker deployments, rebuild your images (docker compose up --build).

See the Changelog for the full migration details.

A modern web application that uses AI to generate HTML, CSS, and JavaScript code based on natural language prompts. Simply describe what you want to build, and the AI will create a complete, self-contained web page for you.

Features

  • AI-Powered Code Generation: Generate complete web pages from text descriptions
  • Live Preview: See your generated code in action with desktop, tablet, and mobile views
  • Code Editing: Edit the generated code directly in the browser
  • Multiple AI Providers: Support for DeepSeek, custom OpenAI-compatible APIs, and local models
  • Responsive Design: Works on desktop and mobile devices
  • Modern UI: Clean, dark-themed interface with a focus on usability

Tech Stack

Getting Started

Prerequisites

  • Deno (version 2.x or higher)
  • Ollama or LM Studio installed
  • OR an API key from one of the supported providers (see below)

Installation

  1. Clone the repository:

    git clone https://github.com/weise25/LocalSite-ai.git
    cd LocalSite-ai
  2. Install the dependencies:

    deno install
  3. Rename the .env.example file in the root directory to .env.local and add your API key:

    # Choose one of the following providers:
    
    # DeepSeek API
    DEEPSEEK_API_KEY=your_deepseek_api_key_here
    DEEPSEEK_API_BASE=https://api.deepseek.com/v1
    
    # Custom OpenAI-compatible API
    # OPENAI_COMPATIBLE_API_KEY=your_api_key_here
    # OPENAI_COMPATIBLE_API_BASE=https://api.openai.com/v1
    
    # Default Provider (deepseek, openai_compatible, ollama, lm_studio)
    DEFAULT_PROVIDER=lm_studio
    
  4. Start the development server:

    deno task dev
  5. Open http://localhost:5173 in your browser.

Supported AI Providers

Local Models

Ollama

  1. Install Ollama on your local machine.
  2. Pull a model like llama2 or codellama.
  3. Start the Ollama server.
  4. Set in your .env.local file:
    OLLAMA_API_BASE=http://localhost:11434
    DEFAULT_PROVIDER=ollama
    

LM Studio

  1. Install LM Studio on your local machine.
  2. Download a model and start the local server.
  3. Set in your .env.local file:
    LM_STUDIO_API_BASE=http://localhost:1234/v1
    DEFAULT_PROVIDER=lm_studio
    

Cloud Models

Cerebras (Create a Website in 3 seconds!)

  1. Visit Cerebras and create an account or sign in.
  2. Navigate to the API keys section.
  3. Create a new API key and copy it.
  4. Set in your .env.local file:
    CEREBRAS_API_KEY=your_cerebras_api_key
    

Google Gemini

  1. Visit Google AI Studio and create an account or sign in.
  2. Navigate to the API keys section.
  3. Create a new API key and copy it.
  4. Set in your .env.local file:
    GOOGLE_GENERATIVE_AI_API_KEY=your_google_api_key
    

Anthropic Claude

  1. Visit Anthropic and create an account or sign in.
  2. Navigate to the API keys section.
  3. Create a new API key and copy it.
  4. Set in your .env.local file:
    ANTHROPIC_API_KEY=your_anthropic_api_key
    

DeepSeek

  1. Visit DeepSeek and create an account or sign in.
  2. Navigate to the API keys section.
  3. Create a new API key and copy it.
  4. Set in your .env.local file:
    DEEPSEEK_API_KEY=your_deepseek_api_key
    DEEPSEEK_API_BASE=https://api.deepseek.com/v1
    

OpenRouter

  1. Visit OpenRouter and create an account or sign in.
  2. Navigate to the API keys section.
  3. Create a new API key and copy it.
  4. Set in your .env.local file:
    OPENROUTER_API_KEY=your_openrouter_api_key
    

Mistral

  1. Visit Mistral AI Studio and create an account or sign in.
  2. Navigate to the API keys section.
  3. Create a new API key and copy it.
  4. Set in your .env.local file:
    MISTRAL_API_KEY=your_mistral_api_key
    

Custom OpenAI-compatible API

You can use any OpenAI-compatible API:

  1. Obtain an API key from your desired provider (OpenAI, Together AI, Groq, etc.).
  2. Set in your .env.local file:
    OPENAI_COMPATIBLE_API_KEY=your_api_key
    OPENAI_COMPATIBLE_API_BASE=https://api.of.provider.com/v1
    

If your OpenAI-compatible provider does not support listing available models (some third-party or self-hosted providers), you can explicitly set a single model ID to use with the OPENAI_COMPATIBLE_MODEL environment variable. When set, the app will return this model instead of attempting to call the provider's models.list endpoint.

Example .env.local:

OPENAI_COMPATIBLE_API_KEY=your_api_key
OPENAI_COMPATIBLE_API_BASE=https://api.of.provider.com/v1
OPENAI_COMPATIBLE_MODEL=gpt-4o-mini

Deployment

This is a SvelteKit app built with @sveltejs/adapter-node. deno task build produces a standalone server in build/, which you run with:

deno task build
deno run -A build/index.js   # listens on port 3000 (set PORT to override)

Docker

A Dockerfile and docker-compose.yml are included (Deno-based). With Docker running:

docker compose up --build

Other hosting options

  • Deno Deploy
  • Any host that can run a Deno (or Node) process and serve the adapter-node output
  • Swap in a different SvelteKit adapter (Vercel, Netlify, Cloudflare) if you prefer a serverless target

Keep in mind that if you host it on a remote platform you cannot reach local models through Ollama or LM Studio unless you expose them, e.g. via tunneling with ngrok.

Usage

  1. Enter a prompt describing what kind of website you want to create.
  2. Select an AI provider and model from the dropdown menu.
  3. Click "GENERATE".
  4. Wait for the code to be generated.
  5. View the live preview and adjust the viewport (Desktop, Tablet, Mobile).
  6. Toggle edit mode to modify the code if needed.
  7. Copy the code or download it as an HTML file.

Roadmap

AI Models and Providers

  • Integration with Ollama for local model execution
  • Support for LM Studio to use local models
  • Predefined provider: DeepSeek
  • Custom OpenAI-compatible API support
  • Support thinking models (Qwen3,DeepCoder, etc.)
  • Adding more predefined providers (Anthropic, Groq, etc.)

Advanced Code Generation

  • Choose between different Frameworks and Libraries (React, Vue, Angular, etc.)
  • File-based code generation (multiple files)
  • Save and load projects
  • Agentic diff-editing capabilities

UI/UX Improvements

  • Dark/Light theme toggle
  • Customizable code editor settings
  • Drag-and-drop interface for UI components
  • History of generated code

Accessibility

  • Transcription and voice input for prompts
  • Anything; feel free to make suggestions

Desktop App

  • Turning into a cross-platform desktop app (Electron)

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

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

About

Generate Web Pages and Components with text prompts, with Local Models. (or Cloud Models, if you want)

Resources

License

Security policy

Stars

404 stars

Watchers

15 watching

Forks

Contributors