Skip to main content

Generates boilerplate code from templates.

Project description

genxcode

genxcode generates boilerplate code from templates.

Use it to create starter code for templates like PyTorch, CUDA, and Hugging Face, then customize the generated project for your use case.

Install

pip install genxcode

CLI Workflow

Run:

genxcode init

It prompts in the terminal:

Enter the name of template:

Accepted inputs include canonical names and aliases:

  • pytorch
  • cuda
  • huggingface
  • hf
  • llm

hf resolves to the Hugging Face template.

If you enter pytorch, genxcode writes genxcode.yaml like this:

# Generated by `genxcode init pytorch`
template: pytorch
name: pytorch
arch: mlp
input_dim: 784
output_dim: 10
hidden:
  - 256
  - 128
activation: relu
metrics:
  - accuracy
  - loss
prod: false
lr: 0.001
epochs: 10
batch_size: 32
device: cpu

Edit the values you want, then generate the project:

genxcode apply

This creates a folder named after name and writes the boilerplate inside it. With the default config above, the output lands in ./pytorch/.

Output:

pytorch/
    src/
        __init__.py
        config.py
        models.py
        data.py
        train.py
        predict.py
    main.py
    requirements.txt

Available templates:

  • pytorch: PyTorch training scaffold
  • cuda: CUDA kernel scaffold
  • huggingface: Hugging Face LLM scaffold

Then run the generated boilerplate:

python main.py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

genxcode-0.1.1.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

genxcode-0.1.1-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

Details for the file genxcode-0.1.1.tar.gz.

File metadata

  • Download URL: genxcode-0.1.1.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.19

File hashes

Hashes for genxcode-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c317983f877dd9cb7b4958a64c20eddfd4586cde56e91c419e366357726ecfd6
MD5 a63c317edb5f0e21d9b35d1247ea0bda
BLAKE2b-256 346be4df501e12d52a32ab9bb1671accd96c884199d8c9b11df72ec98cf20695

See more details on using hashes here.

File details

Details for the file genxcode-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: genxcode-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 16.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.19

File hashes

Hashes for genxcode-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 52a9c660f80c29b5501d5fdf969b2187dc04bca22643c280899dceafe3b509bb
MD5 c44d4363b99f5813495ae17347b18a0e
BLAKE2b-256 9e266141a34c9a9a33d85db57b7889874e84341675fa2f4a55769eca5dc31ef9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page