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.1.0.tar.gz (133.7 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.1.0-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for llm4lint-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b07b8b47257b4a469dbd926c22653c24bc71ba0924e5daffeaa94f871c71ceb9
MD5 f63af05029bc9b661112a303acf5dd17
BLAKE2b-256 df972d6a6a5dccf4e5e6358793f6964162489530c5522273f5d16f193d636b5c

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for llm4lint-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2ff89b814b86ce0a38cf4374213fdb977cc3d40abfbdfe82c063096ade4ae0dd
MD5 412e9088a09b292a9150b5e0501f3f79
BLAKE2b-256 0269db680b91a19d1ec5895800d4e01c8ce6299418cbe2533a88262af91e3cdf

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