Spaces:
Running
<<<<<<< HEAD
ICD-CPT Model
This project implements a FastAPI application that utilizes the Groq API and a language model (Llama 3.3 70b Versatile) to provide CPT and ICD coding based on provider notes. The application is designed to return structured JSON responses that include the predicted codes along with explanations for each code.
Project Structure
src/: Contains the main application code.
- main.py: Entry point for the FastAPI application.
- api/: Contains API route definitions.
- routes.py: Defines the endpoints for the application.
- services/: Contains service logic for interacting with external APIs.
- groq_service.py: Handles requests to the Groq API and processes responses.
- models/: Contains data models for requests and responses.
- request_models.py: Defines request models for incoming data.
- response_models.py: Defines response models for outgoing data.
- config/: Contains configuration settings for the application.
- settings.py: Configuration for API keys and model IDs.
- utils/: Contains utility functions and prompt templates.
- prompts.py: Defines prompt templates for querying the model.
tests/: Contains unit tests for the application.
- test_api.py: Tests for API endpoints.
requirements.txt: Lists the dependencies required for the project.
.env.example: Template for environment variables.
.gitignore: Specifies files to be ignored by Git.
Dockerfile: Instructions for building a Docker image for the application.
Setup Instructions
Clone the Repository: Clone the repository to your local machine.
Create a Virtual Environment: Create a virtual environment to manage dependencies.
python -m venv venvActivate the Virtual Environment: Activate the virtual environment.
- On Windows:
venv\Scripts\activate - On macOS/Linux:
source venv/bin/activate
- On Windows:
Install Dependencies: Install the required dependencies using pip.
pip install -r requirements.txtSet Up Environment Variables: Copy
.env.exampleto.envand fill in the necessary values, including the Groq API key and model ID.Run the Application: Start the FastAPI application.
uvicorn src.main:app --reload
Usage
Endpoint:
/api/codingMethod:
POSTRequest Body:
{ "provider_notes": "Your provider notes here." }Response:
{ "icd_codes": [ { "code": "ICD_CODE_1", "explanation": "Explanation for ICD_CODE_1" } ], "cpt_codes": [ { "code": "CPT_CODE_1", "explanation": "Explanation for CPT_CODE_1" } ] }
Deployment
For deployment, you can use Docker to containerize the application. Follow the instructions in the Dockerfile to build and run the application in a containerized environment.
License
This project is licensed under the MIT License. See the LICENSE file for more details.
title: Icd Cpt Coding Api emoji: π colorFrom: indigo colorTo: indigo sdk: docker pinned: false
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
cc72a56032827788eed3105a0ef90e037552e5a7