weise25/LocalSite-ai
Tentang
Buat halaman web dan komponen dengan prompt teks menggunakan model lokal. Anda juga dapat menggunakan model cloud jika mau.
Pengembangan web dan aplikasiYang dapat Anda lakukan
- 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
Pertumbuhan bintang terukur
- dalam 24 jam
- 0
- dalam 7 hari
- 0
- dalam 15 hari
- 0
- dalam 1 bulan
- Mengumpulkan riwayat
Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.
README.md
AsliWhat's new? See the Changelog for details.
[!IMPORTANT] Security: A compromised build of
[email protected](supply-chain worm, 2026-06-04) could be pulled by the old^2.2.0range. The dependency is now pinned to the safe2.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:
- Install Deno 2.x — Node.js and npm are no longer required.
- Pull the latest code and run
deno install(replacesnpm install).- Keep your existing
.env.local(dev) or.env(production) — environment variable names are unchanged.- Use
deno task dev,deno task build, anddeno task startinstead of npm scripts.- 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
- SvelteKit (Svelte 5 with runes)
- Deno runtime and toolchain
- Tailwind CSS
- Vercel AI SDK (provider streaming)
- Monaco Editor
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
Clone the repository:
git clone https://github.com/weise25/LocalSite-ai.git cd LocalSite-aiInstall the dependencies:
deno installRename the
.env.examplefile in the root directory to.env.localand 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_studioStart the development server:
deno task devOpen http://localhost:5173 in your browser.
Supported AI Providers
Local Models
Ollama
- Install Ollama on your local machine.
- Pull a model like
llama2orcodellama. - Start the Ollama server.
- Set in your
.env.localfile:OLLAMA_API_BASE=http://localhost:11434 DEFAULT_PROVIDER=ollama
LM Studio
- Install LM Studio on your local machine.
- Download a model and start the local server.
- Set in your
.env.localfile:LM_STUDIO_API_BASE=http://localhost:1234/v1 DEFAULT_PROVIDER=lm_studio
Cloud Models
Cerebras (Create a Website in 3 seconds!)
- Visit Cerebras and create an account or sign in.
- Navigate to the API keys section.
- Create a new API key and copy it.
- Set in your
.env.localfile:CEREBRAS_API_KEY=your_cerebras_api_key
Google Gemini
- Visit Google AI Studio and create an account or sign in.
- Navigate to the API keys section.
- Create a new API key and copy it.
- Set in your
.env.localfile:GOOGLE_GENERATIVE_AI_API_KEY=your_google_api_key
Anthropic Claude
- Visit Anthropic and create an account or sign in.
- Navigate to the API keys section.
- Create a new API key and copy it.
- Set in your
.env.localfile:ANTHROPIC_API_KEY=your_anthropic_api_key
DeepSeek
- Visit DeepSeek and create an account or sign in.
- Navigate to the API keys section.
- Create a new API key and copy it.
- Set in your
.env.localfile:DEEPSEEK_API_KEY=your_deepseek_api_key DEEPSEEK_API_BASE=https://api.deepseek.com/v1
OpenRouter
- Visit OpenRouter and create an account or sign in.
- Navigate to the API keys section.
- Create a new API key and copy it.
- Set in your
.env.localfile:OPENROUTER_API_KEY=your_openrouter_api_key
Mistral
- Visit Mistral AI Studio and create an account or sign in.
- Navigate to the API keys section.
- Create a new API key and copy it.
- Set in your
.env.localfile:MISTRAL_API_KEY=your_mistral_api_key
Custom OpenAI-compatible API
You can use any OpenAI-compatible API:
- Obtain an API key from your desired provider (OpenAI, Together AI, Groq, etc.).
- Set in your
.env.localfile: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-nodeoutput - 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
- Enter a prompt describing what kind of website you want to create.
- Select an AI provider and model from the dropdown menu.
- Click "GENERATE".
- Wait for the code to be generated.
- View the live preview and adjust the viewport (Desktop, Tablet, Mobile).
- Toggle edit mode to modify the code if needed.
- 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.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Jelajahi proyek terkait
Memuat…