File size: 370 Bytes
a9bddce
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
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()