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.2.tar.gz (50.1 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.2-py3-none-any.whl (85.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for genxcode-0.1.2.tar.gz
Algorithm Hash digest
SHA256 3fab766ca03c4163bd75e4ae9847d6c26987d9998e7a811222158b14a4027a9c
MD5 adc8460dfcbc44481fc7b583df3fd73a
BLAKE2b-256 8a121ffd74907b98c7878f4211b17f51d568171e670188ecd7a44273b07ee83c

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for genxcode-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4a53d77f59660ddfcd43dc665bdb356a12df591114a94598757e57ee777d9c62
MD5 c292e48e113dce68bbb1f2de1224a26e
BLAKE2b-256 39e7da324c718e1781c3cfbe5930ab5f7d13ebfca60af689510af9ef4563fa05

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