Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
188 changes: 188 additions & 0 deletions misc/generated-internet/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# UV
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
#uv.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
.pdm.toml
.pdm-python
.pdm-build/

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# Visual Studio Code
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
# and can be added to the global gitignore or merged into this file. However, if you prefer,
# you could uncomment the following to ignore the enitre vscode folder
# .vscode/

# Ruff stuff:
.ruff_cache/

# PyPI configuration file
.pypirc

# Cursor
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
# refer to https://docs.cursor.com/context/ignore-files
.cursorignore
.cursorindexingignore
19 changes: 19 additions & 0 deletions misc/generated-internet/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Dockerfile
FROM python:3.12-slim-bookworm
WORKDIR /srv

# Install Python dependencies
COPY requirements.txt /srv/
RUN pip install -r requirements.txt --no-cache-dir

# Copy the application
COPY . /srv

# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV BLOCK_REDOWNDLOAD=True

# Expose ports
EXPOSE 80

CMD ["gunicorn", "src.main:app", "--workers", "4", "--worker-class", "uvicorn.workers.UvicornWorker", "--bind", "0.0.0.0:80"]
75 changes: 75 additions & 0 deletions misc/generated-internet/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Fake Internet 🌐

A project where every web page is dynamically generated by an AI Language Model! Experience a completely artificial internet where each interaction creates new, unique content on the fly.

## Quick Start

### Deploy on Ploomber Cloud

1. **Initialize Ploomber**
```bash
ploomber-cloud init
```

2. **Configure your deployment**

Add the needed `secret-keys` configuration to `ploomber-cloud.json`:
```json
{
"id": "YOUR_PROJECT_ID_HERE",
"type": "docker",
"labels": [],
"secret-keys": ["MODEL_API_KEY", "PROFILE", "VERSION"],
"resources": {
"cpu": 0.5,
"ram": 1,
"gpu": 0
}
}
```

3. **Deploy**
```bash
MODEL_API_KEY=YOUR_MODEL_API_KEY_HERE ploomber-cloud deploy --watch
```

Or if you have a justfile installed:
```bash
just deploy YOUR_MODEL_API_KEY
```

### Run Locally

1. **Install dependencies**
```bash
pip install -r requirements.txt
```

2. **Set up environment variables**

Export your Gemini api key (or other model if changed):
```bash
export MODEL_API_KEY=your_gemini_api_key
```

3. **Run the application**
```bash
python -m src.main
```

Or for development with auto-reload:
```bash
just dev
```

4. **Open your browser**

Navigate to `http://localhost:8080` and start exploring the fake internet!

## 📄 License

MIT

---

_**Warning**: This creates an entirely artificial internet experience. Content is generated by AI and may be unpredictable_
34 changes: 34 additions & 0 deletions misc/generated-internet/justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# List commands
default:
just --list

VERSION := `whoami | tr -d '\n' && echo -n "-" && git rev-parse --short HEAD`

# ---------------------- Helper -----------------------

# Update the requirements.txt files
gen_requirements:
#!/usr/bin/env sh
pip list --format=freeze > requirements.txt

# -------------------- Run locally ---------------------
# Development server
dev:
uvicorn src.main:app --reload --port 8080

# ------------ Docker Build preview --------------

# Build the Docker Image of the Project
build:
docker build . -t debugger-api

# Preview the build with Docker
preview profile model_api_key:
just _req
docker run -p 8080:80 -t -e PROFILE={{profile}} -e MODEL_API_KEY={{model_api_key}} debugger-api

# -------------------- Deploy ---------------------

# Deploy the API to Ploomber Cloud
deploy model_api_key:
PROFILE=PROD MODEL_API_KEY={{model_api_key}} VERSION={{VERSION}} ploomber-cloud deploy
Loading