import gradio as gr from smolagents import CodeAgent, LiteLLMModel model = LiteLLMModel(model_id="ollama/gemma3:12b", api_base="http://localhost:11434") agent = CodeAgent(tools=[], model=model, add_base_tools=True) def run_agent(prompt): return agent.run(prompt) iface = gr.Interface(fn=run_agent, inputs="text", outputs="text", title="Code Agent") iface.launch()