How to speed up openai assistant on flask app

I am trying to develop assistant using openai assistant with flask.
I noticed that assistant reply is little slow. around (6-7 secs)
I am wondering if anyone could review the code, and maybe suggest way to increase the response a bit?

def wait_on_run(run, thread):
    while run.status in ["queued", "in_progress"]:
        run = client.beta.threads.runs.retrieve(
            thread_id=thread.id,
            run_id=run.id,
        )
        time.sleep(0.05)
    return run

def submit_message(assistant_id, thread, user_message):
    client.beta.threads.messages.create(
        thread_id=thread.id, role="user", content=user_message
    )
    return client.beta.threads.runs.create(
        thread_id=thread.id,
        assistant_id=assistant_id,
    )

def get_response(thread):
    return client.beta.threads.messages.list(thread_id=thread.id, order="asc")

def create_thread_and_run(user_input):
    thread = client.beta.threads.create()
    run = submit_message(ASSISTANT_ID, thread, user_input)
    return thread, run




@ask_bp.route('/ask', methods=['POST'])
def ask():
    data = request.json
    user_input = data.get('input')

    if not user_input:
        return jsonify({"error": "No input provided"}), 400

    thread, run = create_thread_and_run(user_input)
    wait_on_run(run, thread)
    messages = get_response(thread)

    response = [m.content[0].text.value for m in messages if m.role == 'assistant']
    return jsonify({"response": response})