Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Desktop applications #125

Closed
wants to merge 56 commits into from
Closed

[WIP] Desktop applications #125

wants to merge 56 commits into from

Conversation

jorge-menjivar
Copy link
Owner

@jorge-menjivar jorge-menjivar commented Dec 5, 2023

Work in progress. This pull request has the code for building Windows, macOS, and Linux applications. This will become a separate app in the monorepo, although this app also contains many updates that will also be merged into the web app.

The following are the things that will differentiate the desktop app:

  • No server-side code
  • API keys are stored in OS keyring/keychain
  • Token count runs over Rust rather than TypeScript
  • All streaming functions are rewritten in Rust to overcome CORS limitations in the browser.
  • Ollama model fetcher was also rewritten in Rust to overcome CORS issue.

Progress:

  • Implement support for local storage
  • Save API keys to OS keyring
  • Change Ollama completion stream so it works locally
  • Change OpenAI completion stream so it works locally
  • Change Anthropic completion stream so it works locally
  • Change PaLM completion steam so it works locally
  • Merge Move from next-auth to supabase-auth (On refactored code) #105 to enable authentication without a server
  • Re-implement support for supabase storage, but with supabase auth
  • Github workflow to automatically produce Linux release
  • Github workflow to automatically produce MacOS release
  • Github workflow to automatically produce Windows release

Instructions to run desktop app:

  1. Make sure that you have all of Tauri's prerequisites: https://tauri.app/v1/guides/getting-started/prerequisites/
  2. pnpm install
  3. cd apps/desktop
  4. pnpm tauri dev

Optional

You shouldn't have to do this for ollama to work, but I'm leaving this just in case.
To access ollama models you must set the env variable OLLAMA_ORIGINS=*://localhost for the ollama service.

Their documentation is not very clear, so here's my guide:

Linux

  1. Add the following content to /etc/systemd/system/ollama.service.d/environment.conf. You may need to create the file and directory.

    [Service]
    Environment="OLLAMA_ORIGINS=*://localhost"
  2. Run

    sudo systemctl daemon-reload
    sudo systemctl restart ollama

macOS

  1. Run OLLAMA_ORIGINS=*://localhost ollama serve

Ollama documentation source

Daniel Farina and others added 26 commits November 24, 2023 02:30
Changes to be committed:
	modified:   apps/unsaged/.env.local.example
	deleted:    apps/unsaged/app/api/auth/[...nextauth]/route.ts
	new file:   apps/unsaged/app/api/auth/route.ts
	modified:   apps/unsaged/app/api/models/route.ts
	new file:   apps/unsaged/app/auth/callback/route.ts
	new file:   apps/unsaged/app/auth/signin/auth-form.tsx
	new file:   apps/unsaged/app/auth/signin/page.tsx
	new file:   apps/unsaged/app/auth/signout/route.ts
	modified:   apps/unsaged/components/Home/components/PrimaryMenu/components/ActivityBar/ActivityBar.tsx
	modified:   apps/unsaged/components/Home/components/SecondaryMenu/components/Menu/components/Screens/ModelSettings/components/model.tsx
	modified:   apps/unsaged/db/GenerationScript.sql
	modified:   apps/unsaged/middleware.ts
	modified:   apps/unsaged/package.json
	deleted:    apps/unsaged/types/auth-provider.ts
	deleted:    apps/unsaged/types/next-auth.d.ts
	new file:   apps/unsaged/types/supabase.types.ts
	modified:   apps/unsaged/utils/app/auth/helpers.ts
	deleted:    apps/unsaged/utils/app/auth/providers.ts
	modified:   apps/unsaged/utils/app/const.ts
	modified:   apps/unsaged/utils/app/storage/supabase/helpers/conversations.ts
	modified:   apps/unsaged/utils/server/ai_vendors/openai/models.ts
	modified:   pnpm-lock.yaml
Copy link

vercel bot commented Dec 5, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unsaged ❌ Failed (Inspect) Dec 23, 2023 2:50am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
unsaged-docs ⬜️ Ignored (Inspect) Visit Preview Dec 23, 2023 2:50am

@sebiweise
Copy link
Collaborator

sebiweise commented Dec 5, 2023

I think we should create a new directory for your changes so our monorepo structure will look like this:
apps
docs
desktop
web

packages
eslint-config-custom
tsconfig
shared-code (coming later)

@Bortus-AI
Copy link
Collaborator

I think we should create a new directory for your changes so our monorepo structure will look like this: apps docs desktop web

packages eslint-config-custom tsconfig shared-code (coming later)

Good idea!

@jorge-menjivar
Copy link
Owner Author

Closing this in favor of #165 to make it easier to merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants