DoublewordDoubleword

smolagents

HuggingFace's smolagents supports custom OpenAI-compatible endpoints via OpenAIServerModel.

Install

pip install smolagents

Configure

from smolagents import OpenAIServerModel, CodeAgent

model = OpenAIServerModel(
    model_id="{{selectedModel.id}}",
    api_base="https://api.doubleword.ai/v1",
    api_key="{{apiKey}}",
)

agent = CodeAgent(model=model, tools=[])
result = agent.run("Say hello.")
print(result)

The api_base parameter is passed directly to the underlying OpenAI client as base_url.