import gradio as gr from blindbox.requests import SecureSession DEMO_SERVER = "4.208.9.167:80" text = "

šŸŽ… SantaCoder with BlindBox: Confidential Coding Assistant


This is a demo to show what Zero Trust LLM usage looks like for the use case of Confidential Coding Assistant.

Here we can leverage a remotely hosted SantaCoder, a state-of-the-art code completion LLM, inside a secure enclave, which ensures code sent for completion is not exposed to anyone else, including us, thanks to end-to-end protection! Therefore LLMs can be leveraged easily to help boost productivity without worrying about IP exposure.

To learn more about how data is secured, you can find out more in our docs.

You can see how we deployed SantaCoder with an Azure Confidential VM by checking out the relevant integration guide in our docs.

āš ļø BlindBox is still under development. We have implemented attestation and deployment on Confidential VMs, but we recommend not to send production data on this demo yet.

If you are interested in pentesting, improving security or knowing more about Confidential LLMs, reach out to us!

" def run_query(prompt): POLICY = "./cce_policy.txt" if prompt == None: return ("ā›” Error: please provide input code") message = "\n\nāœ… Secure query succesful" try: with SecureSession(f"http://{DEMO_SERVER}", POLICY) as secure_session: res = secure_session.post(endpoint="/generate", json={"input_text": prompt}) cleaned = res.text.replace('\\n', '\n').split('\n\n')[0].split(':"')[1] cleaned = cleaned.replace('\\', '') return(cleaned + message) except Exception as err: return(f"ā›” Query failed!\n{err}") demo = gr.Blocks(css=".gradio-container { background-color: #20233fff;} .app.svelte-1mya07g.svelte-1mya07g {max-width: 900px !important;}") with demo: gr.Markdown(value=text) _, colum_2, _ = gr.Column(scale=1), gr.Column(scale=6), gr.Column(scale=1) with colum_2: prompt = gr.Code(lines=3, language="python", label="Input code", value="def hello_name(name):") trigger = gr.Button(label="Run query") with gr.Column(): output = gr.Textbox(placeholder="Output", label="Output") trigger.click(fn=run_query, inputs=[prompt], outputs=[output]) gr.HTML(label="Contact", value="contact") if __name__ == "__main__": demo.launch()