Your Local AI Pair Programmer: Point this AI assistant to your project folder and start asking questions!
Project description
Coding Assistant
Your Local AI Pair Programmer: Point this AI assistant to your project folder and start asking questions!
It reads your code locally to provide truly context-aware help, explanations, and suggestions directly related to your files. Code smarter, locally.
Prerequisites 📝
- Python: Version 3.11 or higher recommended.
treecommand: Theget_tree_folderstool relies on this.- Linux (Debian/Ubuntu):
sudo apt update && sudo apt install tree - macOS (using Homebrew):
brew install tree
- Linux (Debian/Ubuntu):
Installation ⚙️
-
Clone the repository:
git clone https://github.com/Bessouat40/coding-assistant cd coding-assistant
-
Install Python dependencies:
pip install -r requirements.txt
Configuration 🔑
-
API Keys & Settings: Sensitive information like LLM API keys should be stored in a
.envfile in the project's root directory. - Copy the example file or create a new file named.env:cp .env.example .env
-
Edit the
.envfile and add your keys:# .env MISTRAL_API_KEY=your_mistral_api_key_here # GOOGLE_API_KEY=your_google_api_key_here # Add other variables if needed, e.g., MAX_CONTEXT_TOKENS=7000
- LLM Provider: Change LLM provider if you want :
- Go to
api/utils.pyand modifyloadl_llmfunction. Uncomment the line with the provider you need. By default, it's set toGoogle:
def load_llm(logger):
try:
model = ChatOllama(model="llama3.1:8b")
# model = ChatMistralAI(model="codestral-latest")
# model = ChatGoogleGenerativeAI(model="gemini-2.0-flash-001")
logger.info(f"ChatGoogleGenerativeAI model '{model.model}' initialized successfully.")
return model
except Exception as e:
logger.error(f"Failed to initialize the LLM model: {e}")
raise RuntimeError(f"Could not initialize LLM: {e}") from e
Running the Application ▶️
A convenience script launch_assistant.sh is provided to start all components.
-
Make the script executable:
chmod +x launch_assistant.sh
-
Run the script:
./launch_assistant.sh
This script will:
- Load environment variables from
.env. - Start the MCP Tool Server (
agent_tools.py) in the background (logs tomcp_server.log). - Start the FastAPI Backend (
api.py) in the background (logs tofastapi_api.log). - Start the Streamlit UI (
streamlit_app.py) in the background (logs tostreamlit_ui.log). - Print the URLs and PIDs for each component.
You can view logs in the specified .log files for debugging. Press Ctrl+C in the terminal where you ran the script to stop all components gracefully.
Usage 🧑💻
- Access the UI: Open your web browser and navigate to the Streamlit URL (usually
http://localhost:8501). - Set Project Directory: In the sidebar, enter the absolute path to the local project directory you want the assistant to work with. Click "Set Directory".
- Chat: Use the chat input at the bottom to ask questions about the code in the specified directory. Examples:
- "Explain the purpose of the
run_agentfunction inapi.py." - "Show me the file structure of this project." (Uses
tree) - "What arguments does the
generate_response_apifunction take?" - "Read the contents of
prompt.py." (Usescat) - "Can you suggest improvements to the error handling in
streamlit_app.py?"
- "Explain the purpose of the
- Follow-up: The assistant remembers the context of your current chat session. Ask follow-up questions naturally.
- Clear History: Use the "Clear Chat History" button in the sidebar to start a fresh conversation.
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 iflow_mcp_bessouat40_coding_assistant-1.0.0.tar.gz.
File metadata
- Download URL: iflow_mcp_bessouat40_coding_assistant-1.0.0.tar.gz
- Upload date:
- Size: 199.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6752bcedd3ea7a4d1e0d6575643f1c47a0a93b41959756e6067dbb4ff9c13831
|
|
| MD5 |
2cef2ed00ab4400be135d9c05bf5cc94
|
|
| BLAKE2b-256 |
c878d384a55edc479ef44f8c232edbbe118bdc4c6025df78b91a0cc8dbd058d5
|
File details
Details for the file iflow_mcp_bessouat40_coding_assistant-1.0.0-py3-none-any.whl.
File metadata
- Download URL: iflow_mcp_bessouat40_coding_assistant-1.0.0-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb943d4ad2cd62b2532884e914176afe5db42b5920294f852abfcb642b04070f
|
|
| MD5 |
a91ef8fb809e08ebf0f7e80ad80b623f
|
|
| BLAKE2b-256 |
8f8a4c0e4e1fcd9960617489da6ae8ca82bb0063023c74875757e925198b540c
|