Clarity-AI-Agent is a project aimed at enhancing the development of decentralized applications (dApps) by fine-tuning AI models to assist developers in writing smart contracts using the Clarity language. The project focuses on data augmentation techniques to enrich a dataset containing questions, chain-of-thought (CoT) processes, and code responses, which are then utilized to fine-tune the deepseek r1 model using Low-Rank Adaptation (LoRA).
- Make sure you have Python 3.13.1 installed.
- Create a virtual environment:
python -m venv venv
- Activate the virtual environment:
source venv/bin/activate - Install the required packages:
pip install -r requirements.txt
We rely on gemini 2.0 flash, gemini 2.0 pro, and qwen qwq to paraphrase questions and chain-of-thought (CoT) segments using openrouter. We exclude code responses from this process to prevent hallucinations, ensuring the integrity of the generated content.
The following tools and libraries are used in this project:
- Pandas: For dataset manipulation and processing
- OpenAI API: For generating additional training data
- PyTorch: For model training and fine-tuning
- Hugging Face Transformers: For working with the deepseek r1 model
- PEFT: For efficient LoRA fine-tuning techniques
The fine-tuned model is available on Hugging Face:
You can access and download all model files from the repository above to use the fine-tuned DeepSeek-R1 model for Clarity smart contract development.
Training metrics and experiment tracking are available on Weights & Biases:
This report contains detailed information about the fine-tuning process, including loss curves, evaluation metrics, and hyperparameter configurations used during model training.