Dependify uses Groq’s ultra-fast LLM inference to refactor outdated code patterns. The system processes files in parallel using Modal containers with up to 100 concurrent workers, applying modern syntax while maintaining code functionality.
@app.function( timeout=300, # 5 minutes per file max_containers=100, # Process up to 100 files in parallel min_containers=3, # Keep 3 containers warm secrets=[ modal.Secret.from_name("GROQ_API_KEY"), modal.Secret.from_name("SUPABASE_URL"), modal.Secret.from_name("SUPABASE_KEY"), ],)def process_file(job): # Refactor a single file using LLM
Parallelization: Up to 100 files can be refactored simultaneously, dramatically reducing processing time for large repositories.
Files are processed asynchronously using Modal’s .map.aio() method:
server.py:193-207
with write_app.run(): print(f"Starting parallel processing of {len(job_list)} files...") refactored_jobs = [] i = 0 # Process files in parallel async for output in process_file.map.aio(job_list): i += 1 if output and output.get("refactored_code"): refactored_jobs.append({ "path": output["file_path"], "new_content": output["refactored_code"], "confidence_score": output.get("confidence_score", 0) }) print(f"✅ Completed {i}/{len(job_list)}: {file_path}")
For code refactoring, Dependify uses Groq’s llama-3.3-70b-versatile model:
modal_write.py:102-115
job_report = client.chat.completions.create( model="llama-3.3-70b-versatile", messages=[ { "role": "system", "content": "You are a helpful assistant that analyzes code and returns a JSON object with the refactored code and the comments that come with it. Your goal is to identify outdated syntax in code and suggest changes to update it to the latest syntax." }, { "role": "user", "content": user_prompt } ], response_model=JobReport,)
The system uses a detailed prompt to guide the LLM:
modal_write.py:89-98
user_prompt = ( "Analyze the following code and determine if the syntax is out of date. " "If it is out of date, specify what changes need to be made in the following JSON format:\n\n" "{\n" ' "refactored_code": "A rewrite of the file that is more up to date, using the native language (i.e. if the file is a NextJS file, rewrite the NextJS file using Javascript/Typescript with the updated API changes). The file should be a complete file, not just a partial updated code segment.",\n' ' "refactored_code_comments": "Comments and explanations for your code changes. Be as descriptive, informative, and technical as possible."\n' "}\n\n" f"File: {file_path}\n\n" f"Code:\n{code_content}")