Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

647 B
Raw Blame
import * as React from 'react';

import { useApi } from '@/context/ApiContext';
import { modelHubEnabledFromConfig } from './featureFlags';

export const useModelHubCapability = (): boolean | null => {
  const { getConfig } = useApi();
  const [enabled, setEnabled] = React.useState<boolean | null>(null);

  React.useEffect(() => {
    let cancelled = false;
    getConfig()
      .then((config) => {
        if (!cancelled) setEnabled(modelHubEnabledFromConfig(config));
      })
      .catch(() => {
        if (!cancelled) setEnabled(false);
      });
    return () => {
      cancelled = true;
    };
  }, [getConfig]);

  return enabled;
};