CodeMate
Project description
CodeMate: AI-Powered Jupyter Notebook Assistant
CodeMate is a Jupyter notebook extension that leverages powerful AI models for code assistance, debugging, and generation. It supports multiple Large Language Model (LLM) providers, including OpenAI, Anthropic, Google Gemini, and local models via Hugging Face, bringing a versatile range of tools right to your coding environment.
Features
- 🤖 Multiple LLM Provider Support: Seamlessly integrate with OpenAI, Anthropic Claude, Google Gemini, and Hugging Face.
- 🔍 Contextual Code Analysis: Analyze your code's context and structure for better understanding.
- 🐛 AI-Powered Debugging: Get suggestions to fix errors directly within the notebook.
- ✨ Code Generation: Generate new code based on your current project context.
- 📱 Local Model Support: Run models locally using Hugging Face’s Transformers library.
- 📱 Customization: Customize the look and feel of the interface and the LLM interacting with.
- 🚀 Easy Integration: Effortlessly integrate with your Jupyter notebooks for enhanced productivity.
Installation
Install CodeMate via pip:
pip install codemate_ai
Install CodeAssist via git clone:
git clone https://github.com/somethingreallycool123/CodeMate.git
Quick Start
Import the extension in your Jupyter notebook:
%load_ext codemate_ai
Set up your preferred LLM provider:
For API-based LLMs (OpenAI, Anthropic, Google Gemini, etc):
%set_llm_provider <provider_name>
%set_api_key <provider_name> <YOUR_API_KEY>
Local Model Support
CodeAssist also supports running models locally using Hugging Face’s Transformers library:
Download and run a model locally:
%set_llm_provider transformers_download <model_name> --8bit # The --8bit option is optional for reduced memory usage
Use an already downloaded model:
%set_llm_provider transformers_local ./models/my_model
Magic Commands
%set_api_key: Set API keys for different providers.
%set_llm_provider: Configure the LLM provider (e.g., OpenAI, Anthropic, or local models).
%generate_code: Generate new code based on the current context.
%%debug_cell: Debug a cell with AI assistance.
%set_code_theme: Change the background theme of the code solutions.
%set_persona: Change the LLM behaviour to various types including but not limited to detailed, consise, beginnerfriendly etc.
%%refactor_code: Refactors code for modern best practices.
%%explain_code: Cell magic to generate detailed explanation of code.
%%optimize_code: Cell magic to suggest performance optimizations for code.
%%generate_test: Cell magic to generate unit tests for code.
To understand each individual magic command functionality and operations, see Magic function Documentation.
Example Usage
Set up OpenAI as the provider:
%set_api_key openai YOUR_API_KEY
%set_llm_provider openai
Set up a locally running model as provider:
%set_llm_provider transformers_download facebook/opt-350m --8bit
OR
%set_llm_provider transformers_local ./models/my_model
Generate a new function:
%generate_code create_data_pipeline
Debug a problematic cell:
%%debug_cell
def process_data(df):
result = df.groupby('category').mean()
return result['value'] / 0 # Intentional error
Change the background theme:
%set_code_theme rrt
Change the persona of the LLM:
%set_persona expert
Project Structure
CodeMate/
├── codemate_ai/
│ ├── __init__.py
│ ├── core.py
│ ├── magics.py
│ ├── providers.py
├── tests/
│ ├── test_ML.py
│ ├── test_setup.py
├── LICENSE
├── README.md
├── requirements.txt
├── setup.py
└── .gitignore
Contributing
We welcome contributions! If you'd like to improve or add features to CodeAssist, please submit a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contact
For inquiries, please contact us via:
Email: [manangupta9901@gmail.com]
GitHub: somethingreallycool123
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file codemate_ai-0.1.4.tar.gz.
File metadata
- Download URL: codemate_ai-0.1.4.tar.gz
- Upload date:
- Size: 18.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ced814885a7efb5ca94726e2c5d01cb3bac48c5fdfc03bf5cf90242039481c8f
|
|
| MD5 |
3860eb7010f0e441d5c19198704444e2
|
|
| BLAKE2b-256 |
0e9398eb668d8bb0d2d5e7c74502d5336220e1d5977bf11b090a5eb8bc1a0897
|
Provenance
The following attestation bundles were made for codemate_ai-0.1.4.tar.gz:
Publisher:
python-publish.yml on somethingreallycool123/CodeMate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codemate_ai-0.1.4.tar.gz -
Subject digest:
ced814885a7efb5ca94726e2c5d01cb3bac48c5fdfc03bf5cf90242039481c8f - Sigstore transparency entry: 164431881
- Sigstore integration time:
-
Permalink:
somethingreallycool123/CodeMate@27e1732ccc46e25a80d6f837dc10e15b1312b1fe -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/somethingreallycool123
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@27e1732ccc46e25a80d6f837dc10e15b1312b1fe -
Trigger Event:
release
-
Statement type:
File details
Details for the file codemate_ai-0.1.4-py3-none-any.whl.
File metadata
- Download URL: codemate_ai-0.1.4-py3-none-any.whl
- Upload date:
- Size: 17.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a3eebf7a29cb4bdd56b4eb2d191e0457cc50dfebc43e03348547b463e623111
|
|
| MD5 |
177811ea2399be3929cdfa2523b5ca37
|
|
| BLAKE2b-256 |
5f3c40efad56f9ea2caf70c8a99c280f2ad9a2fc79c69ab4adecaf658748ac78
|
Provenance
The following attestation bundles were made for codemate_ai-0.1.4-py3-none-any.whl:
Publisher:
python-publish.yml on somethingreallycool123/CodeMate
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codemate_ai-0.1.4-py3-none-any.whl -
Subject digest:
6a3eebf7a29cb4bdd56b4eb2d191e0457cc50dfebc43e03348547b463e623111 - Sigstore transparency entry: 164431885
- Sigstore integration time:
-
Permalink:
somethingreallycool123/CodeMate@27e1732ccc46e25a80d6f837dc10e15b1312b1fe -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/somethingreallycool123
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@27e1732ccc46e25a80d6f837dc10e15b1312b1fe -
Trigger Event:
release
-
Statement type: