# Use General Inference from an agent

We're a new seller. Default routing picks sellers with a trust score of 60 or more; ours is 5. Pin our peer to reach us. Pins are strict, with no failover.

## Machine-readable endpoints

- [/llms.txt](https://generalinference.org/llms.txt): short index for language models
- [/llms-full.txt](https://generalinference.org/llms-full.txt): the whole site as plain text
- [/pricing.json](https://generalinference.org/pricing.json): prices per 1,000,000 tokens, with `as_of` and `stale_after_seconds`
- [/models.json](https://generalinference.org/models.json): exact model ids, serving kind, health status
- [/status.json](https://generalinference.org/status.json): build-time status snapshot
- [/.well-known/antseed.json](https://generalinference.org/.well-known/antseed.json): identity, pin commands, how to verify
- [/openapi.json](https://generalinference.org/openapi.json): the local buyer API and these feeds
- [/skills/general-inference/SKILL.md](https://generalinference.org/skills/general-inference/SKILL.md): a drop-in agent skill
- [/schemas/pricing.schema.json](https://generalinference.org/schemas/pricing.schema.json), [/schemas/models.schema.json](https://generalinference.org/schemas/models.schema.json), [/schemas/status.schema.json](https://generalinference.org/schemas/status.schema.json): JSON Schemas
- Markdown twins: [/index.md](https://generalinference.org/index.md), [/models.md](https://generalinference.org/models.md), [/quickstart.md](https://generalinference.org/quickstart.md), [/agents.md](https://generalinference.org/agents.md), [/trust.md](https://generalinference.org/trust.md), [/faq.md](https://generalinference.org/faq.md), [/contact.md](https://generalinference.org/contact.md)

## Paste into your agent's instructions

```text
General Inference is a new AntSeed inference seller (https://generalinference.org). Default routing will not pick it yet, so pin it first: use pin_command from /.well-known/antseed.json (see also unpin_command and the single-request peer@model prefix). Pins are strict, with no failover. Use exact model ids from /models.json (for example openai-gpt-61-sol, not gpt-6.1-sol). Test the connection with the free model gemma3:1b. Verify prices and as_of at /pricing.json before spending. There is no hosted inference API; the buyer proxy runs on the local machine.
```

## Which model

| When | Use | Why |
|---|---|---|
| Testing that the connection works | `gemma3:1b` (free) | Costs $0 and needs no wallet balance. |
| Routing, simple classification, short rewrites | `gemma3:1b` (free) | It is a 1-billion-parameter model: fine for small jobs, not for hard reasoning. The free tier is rate-limited. |
| Paid work | An exact id from /models.json | We publish prices, not benchmarks. Judge capability from the model maker’s own documentation, then compare cost with the calculator. |
| Long prompts that repeat a prefix | Compare the cached-input price | Each paid model lists a cached-input price. We do not measure or promise how often it applies. |

## Cost

Cost per run = tokens / 1,000,000 x price, summed over input, cached input and output. The calculator on [the agent hub](https://generalinference.org/agents) does the arithmetic from [/pricing.json](https://generalinference.org/pricing.json).

## Cutting cost

- Prove the connection on `gemma3:1b` before any paid call.
- Send trivial jobs (routing, yes/no classification, short rewrites) to the free model while they fit inside the free tier.
- Estimate a run with the calculator first, then compare it with what you pay today using your own price.
- Read `as_of` in /pricing.json before spending. If it is older than `stale_after_seconds`, re-read the live list.
- Keep prompts short. You pay for every input token on every request.

## Snippets

Every snippet uses the local buyer proxy after `antseed buyer start` and the pin command. Snippets marked untested have not been run end to end yet.

### curl (untested)

```bash
curl -sS http://localhost:8377/v1/chat/completions \
  -H "content-type: application/json" \
  -d '{"model":"gemma3:1b","messages":[{"role":"user","content":"Reply with one word: ready"}]}'
```

### Python openai (untested)

```python
from openai import OpenAI

# The local buyer proxy needs no key. "antseed" is a dummy for SDKs that insist on one.
client = OpenAI(base_url="http://localhost:8377/v1", api_key="antseed")

reply = client.chat.completions.create(
    model="gemma3:1b",
    messages=[{"role": "user", "content": "Reply with one word: ready"}],
)
print(reply.choices[0].message.content)
```

### JS / TS openai (untested)

```typescript
import OpenAI from "openai";

// The local buyer proxy needs no key. "antseed" is a dummy for SDKs that insist on one.
const client = new OpenAI({ baseURL: "http://localhost:8377/v1", apiKey: "antseed" });

const reply = await client.chat.completions.create({
  model: "gemma3:1b",
  messages: [{ role: "user", content: "Reply with one word: ready" }],
});
console.log(reply.choices[0].message.content);
```

### Vercel AI SDK (untested)

```typescript
import { createOpenAI } from "@ai-sdk/openai";
import { generateText } from "ai";

const gi = createOpenAI({ baseURL: "http://localhost:8377/v1", apiKey: "antseed" });

// .chat() selects the chat-completions API, which is what the buyer proxy speaks.
const { text } = await generateText({
  model: gi.chat("gemma3:1b"),
  prompt: "Reply with one word: ready",
});
console.log(text);
```

### LangChain (untested)

```python
from langchain_openai import ChatOpenAI

llm = ChatOpenAI(
    model="gemma3:1b",
    base_url="http://localhost:8377/v1",
    api_key="antseed",  # dummy; the proxy needs no key
)
print(llm.invoke("Reply with one word: ready").content)
```

### LlamaIndex (untested)

```python
from llama_index.llms.openai_like import OpenAILike

llm = OpenAILike(
    model="gemma3:1b",
    api_base="http://localhost:8377/v1",
    api_key="antseed",  # dummy; the proxy needs no key
    is_chat_model=True,
)
print(llm.complete("Reply with one word: ready"))
```

### OpenAI Agents SDK (untested)

```python
from agents import Agent, OpenAIChatCompletionsModel, Runner, set_tracing_disabled
from openai import AsyncOpenAI

set_tracing_disabled(True)  # tracing would call a hosted API
client = AsyncOpenAI(base_url="http://localhost:8377/v1", api_key="antseed")

agent = Agent(
    name="assistant",
    instructions="Answer briefly.",
    model=OpenAIChatCompletionsModel(model="gemma3:1b", openai_client=client),
)
print(Runner.run_sync(agent, "Reply with one word: ready").final_output)
```

### CrewAI (untested)

```python
from crewai import LLM

# The "openai/" prefix tells CrewAI to use an OpenAI-compatible endpoint.
llm = LLM(
    model="openai/gemma3:1b",
    base_url="http://localhost:8377/v1",
    api_key="antseed",  # dummy; the proxy needs no key
)
print(llm.call("Reply with one word: ready"))
```

### Environment variables (untested)

```bash
# Any OpenAI-compatible client that reads these variables will use the local buyer proxy.
# Port 8377 is the CLI default on your machine; change it with: antseed buyer start --port <port>
export OPENAI_BASE_URL=http://localhost:8377/v1
# Optional. The proxy needs no key; set a dummy only if your client insists on one.
export OPENAI_API_KEY=antseed
```

Data last built: Sun Dec 6, 2026, 2:25 PM PT.
