{"id":23922538,"url":"https://github.com/prakash-aryan/slmphi3small","last_synced_at":"2026-05-02T20:33:35.233Z","repository":{"id":246221602,"uuid":"820455985","full_name":"prakash-aryan/slmphi3small","owner":"prakash-aryan","description":"slmphi3small is a chatbot application powered by the Phi-3 language model. It features a React frontend and a Flask backend, allowing users to interact with the Phi-3 model through a user-friendly interface.","archived":false,"fork":false,"pushed_at":"2024-10-03T02:17:41.000Z","size":393,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-23T22:27:59.291Z","etag":null,"topics":["chatbot","flask","phi3","react"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prakash-aryan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-26T13:57:25.000Z","updated_at":"2024-10-03T02:17:44.000Z","dependencies_parsed_at":"2025-02-23T22:25:47.579Z","dependency_job_id":"76555ead-0c9f-47e1-b36a-1f77dc04438f","html_url":"https://github.com/prakash-aryan/slmphi3small","commit_stats":null,"previous_names":["prakash-aryan/slmphi3small"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/prakash-aryan/slmphi3small","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prakash-aryan%2Fslmphi3small","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prakash-aryan%2Fslmphi3small/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prakash-aryan%2Fslmphi3small/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prakash-aryan%2Fslmphi3small/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prakash-aryan","download_url":"https://codeload.github.com/prakash-aryan/slmphi3small/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prakash-aryan%2Fslmphi3small/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32549379,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T19:18:06.202Z","status":"ssl_error","status_checked_at":"2026-05-02T19:16:21.335Z","response_time":132,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chatbot","flask","phi3","react"],"created_at":"2025-01-05T17:14:40.426Z","updated_at":"2026-05-02T20:33:35.217Z","avatar_url":"https://github.com/prakash-aryan.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# slmphi3small\n\nslmphi3small is a chatbot application powered by the Phi-3 language model. It features a React frontend and a Flask backend, allowing users to interact with the Phi-3 model through a user-friendly interface.\n\n## Table of Contents\n- [Credits](#credits)\n- [Project Structure](#project-structure)\n- [Prerequisites](#prerequisites)\n- [Installation](#installation)\n  - [CPU Version](#cpu-version)\n  - [DirectML Version](#directml-version)\n- [Switching Between CPU and DirectML](#switching-between-cpu-and-directml)\n- [Running the Application](#running-the-application)\n- [Troubleshooting](#troubleshooting)\n\n## Credits\n\nThis project is based on the Phi-3 model and uses code from the [onnxruntime-genai](https://github.com/microsoft/onnxruntime-genai) repository by Microsoft. For the latest model and updates, please refer to their [Phi-3 tutorial](https://github.com/microsoft/onnxruntime-genai/blob/main/examples/python/phi-3-tutorial.md).\n\n## Working Example\nhttps://github.com/prakash-aryan/slmphi3small/assets/53960016/0a8d4e2c-5df1-48b2-a10f-dda721bb2f3e\n\n## Project Structure\n\n```\nslmphi3small/\n│\n├── .huggingface/\n├── cpu_and_mobile/\n│   └── cpu-int4-rtn-block-32-acc-level-4/\n├── directml/\n├── frontend/\n│   ├── node_modules/\n│   ├── public/\n│   ├── src/\n│   │   ├── App.css\n│   │   ├── App.js\n│   │   ├── App.test.js\n│   │   ├── index.css\n│   │   ├── index.js\n│   │   ├── logo.svg\n│   │   ├── reportWebVitals.js\n│   │   ├── setupProxy.js\n│   │   └── setupTests.js\n│   ├── .gitignore\n│   ├── package-lock.json\n│   ├── package.json\n│   ├── postcss.config.js\n│   ├── README.md\n│   └── tailwind.config.js\n├── phi3-chat.py\n└── server.py\n```\n\n## Prerequisites\n\nBefore you begin, ensure you have the following installed:\n- Python 3.8 or higher\n- Node.js 14 or higher\n- npm (usually comes with Node.js)\n- Git\n\n## Installation\n\n1. Clone the repository:\n   ```\n   git clone git@github.com:prakash-aryan/slmphi3small.git\n   cd slmphi3small\n   ```\n\n2. Set up the Python environment:\n   ```\n   python -m venv venv\n   source venv/bin/activate  # On Windows, use `venv\\Scripts\\activate`\n   ```\n\n3. Install common Python dependencies:\n   ```\n   pip install flask flask-cors numpy\n   ```\n\n4. Install Hugging Face CLI:\n   ```\n   pip install huggingface_hub\n   ```\n\n### CPU Version\n\n5a. Install CPU-specific dependencies:\n   ```\n   pip install --pre onnxruntime-genai\n   ```\n\n6a. Download the Phi-3 model for CPU:\n   ```\n   huggingface-cli download microsoft/Phi-3-mini-4k-instruct-onnx --include cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4/* --local-dir .\n   ```\n\n### DirectML Version\n\n5b. Install DirectML-specific dependencies:\n   ```\n   pip install --pre onnxruntime-genai-directml\n   ```\n\n6b. Download the Phi-3 model for DirectML:\n   ```\n   huggingface-cli download microsoft/Phi-3-mini-4k-instruct-onnx --include directml/* --local-dir .\n   ```\n\n7. Set up the frontend:\n   ```\n   cd frontend\n   npm install react react-dom axios react-icons framer-motion\n   npm install -D tailwindcss@latest postcss@latest autoprefixer@latest\n   npx tailwindcss init -p\n   ```\n\n   This will:\n   - Install the necessary React packages and dependencies\n   - Install Tailwind CSS and its dependencies\n   - Initialize Tailwind CSS and create the configuration files\n\n## Switching Between CPU and DirectML\n\nBefore running the application, you need to choose whether to use the CPU or DirectML version. To switch between them, modify the `command` variable in `server.py`:\n\nFor CPU:\n```python\ncommand = f'python phi3-chat.py -m cpu_and_mobile/cpu-int4-rtn-block-32-acc-level-4'\n```\n\nFor DirectML:\n```python\ncommand = f'python phi3-chat.py -m directml\\directml-int4-awq-block-128'\n```\n\nEnsure you have installed the corresponding Python package (`onnxruntime-genai` for CPU or `onnxruntime-genai-directml` for DirectML) as mentioned in the installation steps.\n\n## Running the Application\n\n1. Start the Flask backend:\n   In the root directory of the project:\n   ```\n   python server.py\n   ```\n\n2. Start the React frontend:\n   In a new terminal, navigate to the frontend directory:\n   ```\n   cd frontend\n   npm start\n   ```\n\n3. Open your browser and go to `http://localhost:3000` to use the chatbot.\n\n## Troubleshooting\n\nIf you encounter any issues:\n1. Ensure all dependencies are correctly installed.\n2. Check that you've downloaded the correct model files.\n3. Verify that the paths in `server.py` match your project structure.\n\nFor more detailed information or the latest updates on the Phi-3 model, please refer to the [official onnxruntime-genai repository](https://github.com/microsoft/onnxruntime-genai).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprakash-aryan%2Fslmphi3small","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprakash-aryan%2Fslmphi3small","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprakash-aryan%2Fslmphi3small/lists"}