Skip to content

Conversation

@ramonpzg
Copy link
Contributor

@ramonpzg ramonpzg commented Sep 5, 2025

This PR Introduces an interactive API Reference to Jan docs with clean Scalar integration, consistent navigation, and a robust CI flow to keep cloud specs up to date.

What’s included

  • API Reference
    • New reference page at /api with entry points for:
      • Local API (llama.cpp): /api-reference/local
      • Jan Server API (vLLM): /api-reference/cloud
    • Scalar integration with minimal overrides (native styling preserved)
    • Theme sync (light/dark); fixes light-mode logo visibility
    • “Try It Out” supports custom server URL (input, URL param, localStorage) 🙌
    • Auth optional for Local; enforced for Server
  • Navigation
    • Adds Docs ⇄ API Reference nav to regular docs (left of header; no duplication on API pages)
    • API pages use their own layout; regular docs inject nav via config
    • Centralized, scalable pattern for multi-product docs
  • Cloud spec sync (CI/CD)
    • New workflow: .github/workflows/update-cloud-api-spec.yml
      • Manual trigger, webhook, and daily scheduled sync (2 AM UTC)
      • Creates PR or commits directly (configurable)
    • jan-astro-docs.yml updated to conditionally use existing spec for PR/push builds
    • New script: website/scripts/conditional-cloud-spec.js (safe, conditional updates)
    • generate-cloud-spec.js updated (FORCE_UPDATE support, better logs)
  • Docs layout cohesion
    • Main index remains the mission hub; API Reference is now first-class and discoverable
    • Clear paths for future Browser Extension and Server docs to adopt the same nav pattern. This is really important to keep all docs synchronized with minimal effort

Jan Server

image

Jan Local

image

Developer notes

  • Local: bun run api:local or bun run api:dev
  • Force-refresh cloud spec locally: bun run generate:cloud-spec-force
  • Custom server for Try It Out: use the input field or ?server=http://host:port
  • CI daily sync keeps cloud-openapi.json current; manual trigger available for Server team

Validation

  • Built site locally; verified API pages, Try It Out, theme switching, and nav active states
  • CI build path tested with conditional spec generation
  • Confirmed no nav duplication on API pages; visible in regular docs only

Risks / Rollout

  • Cloud spec source outage: build falls back to last good spec (no build break)
  • If removing legacy scripts/workflows, confirm no external jobs still depend on them

Impact

  • Makes our OpenAI-compatible API a first-class citizen
  • Aligns docs with Jan’s ecosystem narrative
  • Reduces styling debt and improves maintainability
  • Establishes a dependable, auditable spec update pipeline

@ramonpzg ramonpzg added this to the v0.7.0 milestone Sep 5, 2025
@ramonpzg ramonpzg self-assigned this Sep 5, 2025
@ramonpzg ramonpzg added this to Jan Sep 5, 2025
@ellipsis-dev
Copy link
Contributor

ellipsis-dev bot commented Sep 5, 2025

⚠️ This PR is too big for Ellipsis, but support for larger PRs is coming soon. If you want us to prioritize this feature, let us know at [email protected]


Generated with ❤️ by ellipsis.dev

@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2025

Preview URL Astro Docs: https://68c1fa0e.astro-docs-14t.pages.dev

@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2025

@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2025

@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2025

@ramonpzg ramonpzg merged commit 88fb1ac into dev Sep 5, 2025
1 check passed
@ramonpzg ramonpzg deleted the rp/api-docs branch September 5, 2025 11:44
@github-project-automation github-project-automation bot moved this to QA in Jan Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants