Inspiration
Most agent projects publish a demo and a prompt, but another agent cannot tell what the system will refuse, what it will short-circuit, or where it hands control back to a human. That is a trust problem for the agentic web. Xiaoyuan 14B started from a hard resource constraint: one 14B open-weight model, about 9 GB of RAM, a 4k working context, and no cloud dependency. The constraint forced a different design: deterministic gates first, model second, post-check last.
What it does
Xiaoyuan 14B is a local-first agent architecture around Qwen2.5 14B Instruct (Q4_K_M, served by Ollama). It routes a request into a scenario before generation, short-circuits high-confidence crisis or unsafe cases without a model call, injects a task-specific constraint block, calls the local model when needed, and repairs missing critical fields or unsafe framing before display.
The public submission is a browser-native portable agent network. agent-manifest.json declares the network, xiaoyuan_14b.network.json defines three agents (front agent, safety gate, project facts), and runtime.js loads and validates the network in the browser. The demo runs a deterministic local path with no key, exposes one grounded read-only site action, and optionally supports a visitor-supplied OpenAI-compatible BYOK router. The key stays in browser-local storage and is sent only to the router the visitor enters.
How we built it
The production architecture is a Python layer around a local Ollama model: routing before generation, deterministic gates for high-confidence cases, short task blocks for a 4k context, a separate post-check stage, and compact history plus a hard-constraint summary. The public site turns that design into a discovery surface: an A2A-style agent card, an llms.txt summary, a read-only OpenAPI description, a human project page, and the browser agent demo.
The repository intentionally does not include private production source or model weights. It publishes the architecture, evidence, metadata, and a portable demo. It does not claim a live hosted 14B inference endpoint.
Challenges we ran into
- A 14B model at 4k context loses hard constraints across turns. The fix was a compact history plus a separate constraint summary, not a bigger prompt.
- A correct-looking answer can still omit an emergency-first sentence. The fix was a scenario-specific post-check, not a stronger model.
- A public agent card can easily overclaim. The fix was explicit
x-live-endpoint: falsemetadata and a visible boundary section. - GitHub Pages does not provide custom CORS headers, so cross-origin peer loading is not claimed; the published demo is same-origin.
Accomplishments that we're proud of
- 10/10 local tasks and 31/31 turns completed.
- 45/45 automated regression tests OK.
- 89/100 local strict self-score, with safety-critical Q4/Q6/Q10 passed.
- A deterministic crisis gate that stops the path before generation.
- A public, machine-readable project surface that states its own limits.
These are local results, not official scores, rankings, or leaderboard entries.
What we learned
Safety is not a prompt. It is a system property: routing, gates, constraints, post-checks, and a release test suite. A small model can be made more trustworthy in a narrow domain by making the failure path deterministic. A public agent card is only useful if it is honest about what the agent cannot do.
What's next
- Add a public, rate-limited demo endpoint on a host with enough RAM, labeled as a local model rather than a cloud service.
- Add an A2A message endpoint and a signed capability manifest.
- Add a Relate-based memory graph branch for multi-turn constraints.
- Add a Gemma 4 branch only if a competition requires that base model; it is a separate build, not a rename.
How it follows the Open Agentic Web MVP spec
- The site publishes
agent-manifest.json,xiaoyuan_14b.network.json,links.json, andruntime.jsat stable public URLs. - The manifest declares the network and
front_man; the network file is a resolved, data-only agent graph with a front agent, a safety gate, and a project-facts agent. - The browser runtime validates the manifest and network before any agent call, runs the front agent, invokes the safety gate first, and exposes one read-only site action.
- The demo is same-origin on GitHub Pages. Custom CORS headers are not available on Pages, so cross-origin peer loading is not claimed.
- The default LLM router is a deterministic local policy, not a hosted model. BYOK is optional; the key stays in the caller's browser and is sent only to the router the visitor enters.
Built With
- a2a
- gguf
- github
- javascript
- json
- ollama
- python
- qwen2.5-14b