myhomelab/README.md

81 lines
2.6 KiB
Markdown

## ⚙️ Requerimentos
Antes de começar, certifique-se de ter instaladas as dependências principais:
### 🧱 Sistema e Build
```bash
sudo apt update
sudo apt install -y \
autoconf automake libtool \
build-essential pkg-config \
git python3 python3-venv python3-pip \
make
```
## Passos
1. Execute `aclocal` para criar **aclocal.m4** e o diretório **autom4te.cache/**.
2. Execute `autoconf` para gerar o script **configure**.
3. Execute `automake --add-missing` para criar os ficheiros **Makefile.in**.
4. Execute `./configure` para gerar os ficheiros **Makefile**.
5. Execute `make` para compilar e criar o executável.
6. Execute `src/myhomelab` para correr o executável.
## Alvos Extras
```
make git # commit + push automático
make tarball # gera dist/myhomelab-src.tar.gz
make release # publica release e cria tag automática
```
```
myhomelab/
├─ configure.ac
├─ Makefile.am
├─ README.md
├─ pyproject.toml # uv + ruff + (pytest)
├─ uv.lock
├─ src/
│ └─ neuro/
│ ├─ __init__.py
│ ├─ cli.py # entrypoints (tui / bench / repl)
│ │
│ ├─ tui/
│ │ ├─ app.py # Textual App
│ │ ├─ screens.py # screens/modals
│ │ ├─ widgets.py # componentes reutilizáveis
│ │ └─ state.py # estado e store (sem IA aqui)
│ │
│ ├─ engine/
│ │ ├─ __init__.py
│ │ ├─ session.py # Session, Chat/Prompt state
│ │ └─ runtime.py # “orquestração” do loop (streaming, cancel)
│ │
│ ├─ ai/
│ │ ├─ __init__.py
│ │ ├─ config.py # dataclasses: dims, vocab, layers, seed
│ │ ├─ tokenizer.py # tokenize/detokenize
│ │ ├─ embeddings.py # tok->vec, pos enc
│ │ ├─ transformer.py # forward() (minimo)
│ │ ├─ head.py # logits/probs
│ │ ├─ sampling.py # greedy, top-k, top-p, temp
│ │ └─ model.py # Model = cola tudo (tokenize->sample)
│ │
│ ├─ utils/
│ │ ├─ logging.py
│ │ ├─ rng.py
│ │ └─ perf.py
│ │
│ └─ data/
│ ├─ vocab.json # opcional no MVP
│ └─ tiny_weights.npz # opcional (se quiseres pesos fixos)
├─ tests/
│ ├─ test_tokenizer.py
│ ├─ test_sampling.py
│ └─ test_transformer_shapes.py
└─ tools/
├─ bench.py # microbench do forward/sampling
└─ export_vocab.py
```