from fastapi import FastAPI import subprocess # Import subprocess module to run system commands import ollama app = FastAPI() @app.get("/") def read_root(): return {"message": "Welcome to the Quantum-API/codelama"} # Add other endpoints as needed for interacting with ollama @app.get("/run-codelama") def run_codelama(): # You can call ollama commands here or use subprocess result = subprocess.run(["ollama", "run", "codellama:latest"], capture_output=True, text=True) return {"result": result.stdout}