Quantum-API / api /endpoints /codelama.py
subatomicERROR's picture
Initial commit: Quantum-API with FastAPI and Streamlit integration
f33e2be
raw
history blame
523 Bytes
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}