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.3.tar.gz (61.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.3-py3-none-any.whl (108.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for genxcode-0.1.3.tar.gz
Algorithm Hash digest
SHA256 85d0a010dc60d11e160b8fe2a5f557d127c7633264735f46f54f8ed5623aad82
MD5 492154c04854f1ae65927f03b90834b1
BLAKE2b-256 bcdfdd3f2aac368d455cac9a137afd5226f018112541a8ab1988aaeeab3171df

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for genxcode-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 42e1e8126e3468052ca5b1ddea07aec9121c17294efb96ec9275c434e1752e5a
MD5 49b587b01765a87b6c18e5ec3c734d69
BLAKE2b-256 1a75ac1a20a81841cce2d991ab83923c5402e461ff66c41bb63e5662f839ef76

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