Skip to main content

A Linter that uses LLM to analyze code

Project description

LLM4LINT

A Static Analysis Tool built by finetuning Qwen2.5 Coder using unsloth.

Features:

  • Linting of Python source code in traditional linting format and an interactive mode.
  • You can also provide your own data to create a different model (use train.py script):
    • Specify your own examples in a csv file with input and output columns. output should be <lineno> - <type>: <issue>. With just 1 example multiple datapoints are created using augmentation.
    • Augmentation of inputs:
      • Variable names are replaced with different names to make sure model does not memorize the code.
      • Additional code is added before and after your input example. (outputs are also adjusted to account for lineno changes).
  • Dataset created using this script: https://huggingface.co/datasets/ahmedhus22/python-static-analysis-linting

Usage:

llm4lint [-h] [-i] filename

  • positional arguments: filename Python Source File to lint

  • options:

    • -h, --help show this help message and exit
    • -i, --interactive starts chat interface for interacting with model

Installation (For Inference Only)

pip install llm4lint
  • Download the fine-tuned model from Hugging Face .gguf and Modelfile

  • Create ollama Model

`ollama create llm4lint7b -f <Modelfile-Path>`

Now, You can access the linter anywhere in terminal using

llm4lint <filename> [options]

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

llm4lint-0.0.1.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

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

llm4lint-0.0.1-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

Details for the file llm4lint-0.0.1.tar.gz.

File metadata

  • Download URL: llm4lint-0.0.1.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.13

File hashes

Hashes for llm4lint-0.0.1.tar.gz
Algorithm Hash digest
SHA256 2a9a68c7d75acae9b4688f4e218056bfc8fd44a8e2aeb48733a79522217210cc
MD5 d4bc68059191c4206408d65edc89caa9
BLAKE2b-256 ebd911cca0d3d63df4d364ddb26b6097539aeb92643ec14c6b023dbd37899309

See more details on using hashes here.

File details

Details for the file llm4lint-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: llm4lint-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 16.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.13

File hashes

Hashes for llm4lint-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4be4b1ebe09b86a9daf8dcc8d0c4118a99ebb085034d0e9c6ca4481c918df3c8
MD5 d3ad3d832178f0021498a0d00e805563
BLAKE2b-256 061e33658c74a3c6e41d8386751490a921fc2b968096bf8cd50a52d12b8edd73

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