Skip to content

OpenAI-compat: AtomicAgent Mode.JSON on factory and AgentConfig, not default tools mode #282

Description

@cursor

Working config (from_openai + Mode.JSON on factory and AgentConfig)

AtomicAgent takes an Instructor-wrapped client. Default AgentConfig.mode is tools mode and the default model is gpt-5-mini. An OpenAI-compatible Chat Completions host that does not speak tools needs Mode.JSON on both instructor.from_openai(...) and AgentConfig(...). The modes must match. from_provider("openai/...") is the first-party host.

A Chat Completions host whose public catalog is GET https://api.pzero.studio/v1/models (no key) fits if base_url is https://api.pzero.studio/v1.

import instructor
from openai import OpenAI
from atomic_agents import AtomicAgent, AgentConfig, BasicChatInputSchema, BasicChatOutputSchema

client = instructor.from_openai(
    OpenAI(api_key="<Bearer key for that host>", base_url="https://api.pzero.studio/v1"),
    mode=instructor.Mode.JSON,
)

agent = AtomicAgent[BasicChatInputSchema, BasicChatOutputSchema](
    config=AgentConfig(
        client=client,
        model="deepseek-v4-flash",
        mode=instructor.Mode.JSON,
    ),
)

Keep embeddings off this host.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions