Skip to main content

OpenAI-compatible surface

Every GeneralCompute endpoint mirrors the OpenAI API shape (chat.completions, models, etc.). Use any existing OpenAI SDK or the official @generalcompute/sdk / generalcompute packages — no request body changes required.

Tool calling & JSON mode

Function and tool calling are fully supported. Define tools exactly as you would with OpenAI and inspect the returned tool_calls array to decide which function to execute.
const completion = await client.chat.completions.create({
  model: "deepseek-v3.2",
  messages,
  tools: [
    {
      type: "function",
      function: {
        name: "get_weather",
        description: "Look up the weather for a city",
        parameters: {
          type: "object",
          properties: { location: { type: "string" } },
          required: ["location"],
        },
      },
    },
  ],
  response_format: { type: "json_object" }, // JSON mode
});
Tool calls stream through the same delta events you receive from OpenAI, so orchestrators such as LangChain, Vercel AI SDK, and LlamaIndex work out of the box.

Vision

Pass images alongside text in the messages array using the OpenAI "image_url" parts. Vision is available on models like llama-4-maverick-17b and gemma-3-12b-it.
response = client.chat.completions.create(
    model="llama-4-maverick-17b",
    messages=[
        {
            "role": "user",
            "content": [
                {"type": "text", "text": "Describe this image"},
                {
                    "type": "image_url",
                    "image_url": {"url": "https://example.com/photo.jpg"},
                },
            ],
        }
    ],
)

Reasoning models

Reasoning-first models (deepseek-v3.2, deepseek-r1-0528, etc.) are deployed with long context windows and higher thinking timeouts. Use them when you need chain-of-thought quality:
const completion = await client.chat.completions.create({
  model: "deepseek-v3.2",
  messages,
  temperature: 0.1,
  max_completion_tokens: 2048,
});
Combine reasoning with tool calling to build autonomous agents without changing your orchestrator code.