Skip to content

Commit 1664055

Browse files
authored
Merge pull request #445 from thecodacus/docs
docs: added documentation creation framework
2 parents 802293f + 05e5ec8 commit 1664055

File tree

10 files changed

+1397
-0
lines changed

10 files changed

+1397
-0
lines changed

.github/workflows/docs.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Docs CI/CD
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
permissions:
9+
contents: write
10+
jobs:
11+
build_docs:
12+
runs-on: ubuntu-latest
13+
defaults:
14+
run:
15+
working-directory: ./docs
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Configure Git Credentials
19+
run: |
20+
git config user.name github-actions[bot]
21+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
22+
- uses: actions/setup-python@v5
23+
with:
24+
python-version: 3.x
25+
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
26+
- uses: actions/cache@v4
27+
with:
28+
key: mkdocs-material-${{ env.cache_id }}
29+
path: .cache
30+
restore-keys: |
31+
mkdocs-material-
32+
33+
- run: pip install mkdocs-material
34+
- run: mkdocs gh-deploy --force

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,6 @@ _worker.bundle
3333

3434
Modelfile
3535
modelfiles
36+
37+
# docs ignore
38+
site

docs/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.venv
2+
site/

docs/README.md

Whitespace-only changes.

docs/docs/CONTRIBUTING.md

Lines changed: 218 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,218 @@
1+
# Contribution Guidelines
2+
3+
## DEFAULT_NUM_CTX
4+
5+
The `DEFAULT_NUM_CTX` environment variable can be used to limit the maximum number of context values used by the qwen2.5-coder model. For example, to limit the context to 24576 values (which uses 32GB of VRAM), set `DEFAULT_NUM_CTX=24576` in your `.env.local` file.
6+
7+
First off, thank you for considering contributing to Bolt.new! This fork aims to expand the capabilities of the original project by integrating multiple LLM providers and enhancing functionality. Every contribution helps make Bolt.new a better tool for developers worldwide.
8+
9+
## 📋 Table of Contents
10+
- [Code of Conduct](#code-of-conduct)
11+
- [How Can I Contribute?](#how-can-i-contribute)
12+
- [Pull Request Guidelines](#pull-request-guidelines)
13+
- [Coding Standards](#coding-standards)
14+
- [Development Setup](#development-setup)
15+
- [Deploymnt with Docker](#docker-deployment-documentation)
16+
17+
## Code of Conduct
18+
19+
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to the project maintainers.
20+
21+
## How Can I Contribute?
22+
23+
### 🐞 Reporting Bugs and Feature Requests
24+
- Check the issue tracker to avoid duplicates
25+
- Use the issue templates when available
26+
- Include as much relevant information as possible
27+
- For bugs, add steps to reproduce the issue
28+
29+
### 🔧 Code Contributions
30+
1. Fork the repository
31+
2. Create a new branch for your feature/fix
32+
3. Write your code
33+
4. Submit a pull request
34+
35+
### ✨ Becoming a Core Contributor
36+
We're looking for dedicated contributors to help maintain and grow this project. If you're interested in becoming a core contributor, please fill out our [Contributor Application Form](https://forms.gle/TBSteXSDCtBDwr5m7).
37+
38+
## Pull Request Guidelines
39+
40+
### 📝 PR Checklist
41+
- [ ] Branch from the main branch
42+
- [ ] Update documentation if needed
43+
- [ ] Manually verify all new functionality works as expected
44+
- [ ] Keep PRs focused and atomic
45+
46+
### 👀 Review Process
47+
1. Manually test the changes
48+
2. At least one maintainer review required
49+
3. Address all review comments
50+
4. Maintain clean commit history
51+
52+
## Coding Standards
53+
54+
### 💻 General Guidelines
55+
- Follow existing code style
56+
- Comment complex logic
57+
- Keep functions focused and small
58+
- Use meaningful variable names
59+
60+
## Development Setup
61+
62+
### 🔄 Initial Setup
63+
1. Clone the repository:
64+
```bash
65+
git clone https://github.com/coleam00/bolt.new-any-llm.git
66+
```
67+
68+
2. Install dependencies:
69+
```bash
70+
pnpm install
71+
```
72+
73+
3. Set up environment variables:
74+
- Rename `.env.example` to `.env.local`
75+
- Add your LLM API keys (only set the ones you plan to use):
76+
```bash
77+
GROQ_API_KEY=XXX
78+
HuggingFace_API_KEY=XXX
79+
OPENAI_API_KEY=XXX
80+
ANTHROPIC_API_KEY=XXX
81+
...
82+
```
83+
- Optionally set debug level:
84+
```bash
85+
VITE_LOG_LEVEL=debug
86+
```
87+
88+
- Optionally set context size:
89+
```bash
90+
DEFAULT_NUM_CTX=32768
91+
```
92+
93+
Some Example Context Values for the qwen2.5-coder:32b models are.
94+
95+
* DEFAULT_NUM_CTX=32768 - Consumes 36GB of VRAM
96+
* DEFAULT_NUM_CTX=24576 - Consumes 32GB of VRAM
97+
* DEFAULT_NUM_CTX=12288 - Consumes 26GB of VRAM
98+
* DEFAULT_NUM_CTX=6144 - Consumes 24GB of VRAM
99+
100+
**Important**: Never commit your `.env.local` file to version control. It's already included in .gitignore.
101+
102+
### 🚀 Running the Development Server
103+
```bash
104+
pnpm run dev
105+
```
106+
107+
**Note**: You will need Google Chrome Canary to run this locally if you use Chrome! It's an easy install and a good browser for web development anyway.
108+
109+
## Testing
110+
111+
Run the test suite with:
112+
113+
```bash
114+
pnpm test
115+
```
116+
117+
## Deployment
118+
119+
To deploy the application to Cloudflare Pages:
120+
121+
```bash
122+
pnpm run deploy
123+
```
124+
125+
Make sure you have the necessary permissions and Wrangler is correctly configured for your Cloudflare account.
126+
127+
# Docker Deployment Documentation
128+
129+
This guide outlines various methods for building and deploying the application using Docker.
130+
131+
## Build Methods
132+
133+
### 1. Using Helper Scripts
134+
135+
NPM scripts are provided for convenient building:
136+
137+
```bash
138+
# Development build
139+
npm run dockerbuild
140+
141+
# Production build
142+
npm run dockerbuild:prod
143+
```
144+
145+
### 2. Direct Docker Build Commands
146+
147+
You can use Docker's target feature to specify the build environment:
148+
149+
```bash
150+
# Development build
151+
docker build . --target bolt-ai-development
152+
153+
# Production build
154+
docker build . --target bolt-ai-production
155+
```
156+
157+
### 3. Docker Compose with Profiles
158+
159+
Use Docker Compose profiles to manage different environments:
160+
161+
```bash
162+
# Development environment
163+
docker-compose --profile development up
164+
165+
# Production environment
166+
docker-compose --profile production up
167+
```
168+
169+
## Running the Application
170+
171+
After building using any of the methods above, run the container with:
172+
173+
```bash
174+
# Development
175+
docker run -p 5173:5173 --env-file .env.local bolt-ai:development
176+
177+
# Production
178+
docker run -p 5173:5173 --env-file .env.local bolt-ai:production
179+
```
180+
181+
## Deployment with Coolify
182+
183+
[Coolify](https://github.com/coollabsio/coolify) provides a straightforward deployment process:
184+
185+
1. Import your Git repository as a new project
186+
2. Select your target environment (development/production)
187+
3. Choose "Docker Compose" as the Build Pack
188+
4. Configure deployment domains
189+
5. Set the custom start command:
190+
```bash
191+
docker compose --profile production up
192+
```
193+
6. Configure environment variables
194+
- Add necessary AI API keys
195+
- Adjust other environment variables as needed
196+
7. Deploy the application
197+
198+
## VS Code Integration
199+
200+
The `docker-compose.yaml` configuration is compatible with VS Code dev containers:
201+
202+
1. Open the command palette in VS Code
203+
2. Select the dev container configuration
204+
3. Choose the "development" profile from the context menu
205+
206+
## Environment Files
207+
208+
Ensure you have the appropriate `.env.local` file configured before running the containers. This file should contain:
209+
- API keys
210+
- Environment-specific configurations
211+
- Other required environment variables
212+
213+
## Notes
214+
215+
- Port 5173 is exposed and mapped for both development and production environments
216+
- Environment variables are loaded from `.env.local`
217+
- Different profiles (development/production) can be used for different deployment scenarios
218+
- The configuration supports both local development and production deployment

docs/docs/FAQ.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# FAQ
2+
3+
### How do I get the best results with oTToDev?
4+
5+
- **Be specific about your stack**: If you want to use specific frameworks or libraries (like Astro, Tailwind, ShadCN, or any other popular JavaScript framework), mention them in your initial prompt to ensure Bolt scaffolds the project accordingly.
6+
7+
- **Use the enhance prompt icon**: Before sending your prompt, try clicking the 'enhance' icon to have the AI model help you refine your prompt, then edit the results before submitting.
8+
9+
- **Scaffold the basics first, then add features**: Make sure the basic structure of your application is in place before diving into more advanced functionality. This helps oTToDev understand the foundation of your project and ensure everything is wired up right before building out more advanced functionality.
10+
11+
- **Batch simple instructions**: Save time by combining simple instructions into one message. For example, you can ask oTToDev to change the color scheme, add mobile responsiveness, and restart the dev server, all in one go saving you time and reducing API credit consumption significantly.
12+
13+
### How do I contribute to oTToDev?
14+
15+
[Please check out our dedicated page for contributing to oTToDev here!](CONTRIBUTING.md)
16+
17+
### Do you plan on merging oTToDev back into the official Bolt.new repo?
18+
19+
More news coming on this coming early next month - stay tuned!
20+
21+
### What are the future plans for oTToDev?
22+
23+
[Check out our Roadmap here!](https://roadmap.sh/r/ottodev-roadmap-2ovzo)
24+
25+
Lot more updates to this roadmap coming soon!
26+
27+
### Why are there so many open issues/pull requests?
28+
29+
oTToDev was started simply to showcase how to edit an open source project and to do something cool with local LLMs on my (@ColeMedin) YouTube channel! However, it quickly
30+
grew into a massive community project that I am working hard to keep up with the demand of by forming a team of maintainers and getting as many people involved as I can.
31+
That effort is going well and all of our maintainers are ABSOLUTE rockstars, but it still takes time to organize everything so we can efficiently get through all
32+
the issues and PRs. But rest assured, we are working hard and even working on some partnerships behind the scenes to really help this project take off!
33+
34+
### How do local LLMs fair compared to larger models like Claude 3.5 Sonnet for oTToDev/Bolt.new?
35+
36+
As much as the gap is quickly closing between open source and massive close source models, you’re still going to get the best results with the very large models like GPT-4o, Claude 3.5 Sonnet, and DeepSeek Coder V2 236b. This is one of the big tasks we have at hand - figuring out how to prompt better, use agents, and improve the platform as a whole to make it work better for even the smaller local LLMs!
37+
38+
### I'm getting the error: "There was an error processing this request"
39+
40+
If you see this error within oTToDev, that is just the application telling you there is a problem at a high level, and this could mean a number of different things. To find the actual error, please check BOTH the terminal where you started the application (with Docker or pnpm) and the developer console in the browser. For most browsers, you can access the developer console by pressing F12 or right clicking anywhere in the browser and selecting “Inspect”. Then go to the “console” tab in the top right.
41+
42+
### I'm getting the error: "x-api-key header missing"
43+
44+
We have seen this error a couple times and for some reason just restarting the Docker container has fixed it. This seems to be Ollama specific. Another thing to try is try to run oTToDev with Docker or pnpm, whichever you didn’t run first. We are still on the hunt for why this happens once and a while!
45+
46+
### I'm getting a blank preview when oTToDev runs my app!
47+
48+
We promise you that we are constantly testing new PRs coming into oTToDev and the preview is core functionality, so the application is not broken! When you get a blank preview or don’t get a preview, this is generally because the LLM hallucinated bad code or incorrect commands. We are working on making this more transparent so it is obvious. Sometimes the error will appear in developer console too so check that as well.
49+
50+
### Everything works but the results are bad
51+
52+
This goes to the point above about how local LLMs are getting very powerful but you still are going to see better (sometimes much better) results with the largest LLMs like GPT-4o, Claude 3.5 Sonnet, and DeepSeek Coder V2 236b. If you are using smaller LLMs like Qwen-2.5-Coder, consider it more experimental and educational at this point. It can build smaller applications really well, which is super impressive for a local LLM, but for larger scale applications you want to use the larger LLMs still!

0 commit comments

Comments
 (0)