this post was submitted on 03 Nov 2024
392 points (98.0% liked)

Open Source

31787 readers
234 users here now

All about open source! Feel free to ask questions, and share news, and interesting stuff!

Useful Links

Rules

Related Communities

Community icon from opensource.org, but we are not affiliated with them.

founded 5 years ago
MODERATORS
top 50 comments
sorted by: hot top controversial new old
[–] iopq 63 points 1 month ago (3 children)

I have some suggestions: let's not make people translate to English unless they are learning English. I don't want to be thinking about whether "I'm coming Friday" is correct grammar in English. I want to be thinking about my target language!

[–] Cr4yfish 33 points 1 month ago* (last edited 1 month ago)

Thanks for the suggestion, I’ll definitely try to make the app as language inclusive as possible!

Also, sorry if I might’ve been too vague with the post title. The app is just similar to Duolingo in terms of structure and the idea, however it’s not specific to language learning but supposed to cater to any subject, really.

For example, I personally use it to study for my university subjects.

[–] [email protected] 11 points 1 month ago* (last edited 1 month ago) (8 children)

Yeah, it's my minor pet peeve with Duolingo, like source language and my language doesn't have/need suffixes like "the" or "a" so I often forget about it, it's soo annoying to fail because of such minor thing, especially when their suggested English often looks terrible

load more comments (8 replies)
[–] [email protected] 11 points 1 month ago

This app seems to be about any generic courses, not just language learning. So someone can make a language course in the way you've described

[–] [email protected] 19 points 1 month ago (3 children)
[–] [email protected] 54 points 1 month ago* (last edited 1 month ago) (1 children)

In case OP doesn’t know, if a repo hasn’t got a licence it’s implied it’s licensed under "all rights reserved", so not open source! You need to https://choosealicense.com

[–] Cr4yfish 46 points 1 month ago (3 children)

it’s implied it’s licensed under "all rights reserved", so not open source!

Oh, I actually did not know that. I'll try to remember adding a License right from the get-go from now on, thanks :)

[–] [email protected] 23 points 1 month ago (1 children)

I think you want to use AGPL. people can still make a closed source website out of your project due to the ASP loophole.

[–] Cr4yfish 17 points 1 month ago

Yeah you're right. I switched it to AGPL.

[–] [email protected] 8 points 1 month ago

Ah, yes, GPLv3, exquisite choice.

[–] [email protected] 3 points 1 month ago
[–] Cr4yfish 17 points 1 month ago

It's GPLv3 now.

[–] Cr4yfish 5 points 1 month ago

oh, right. Forget that every time. I'll add one.

[–] [email protected] 17 points 1 month ago* (last edited 1 month ago) (1 children)

This is a really great use of LLM! Seriously great job! Once it's fully self-hostable (including the LLM model), I will absolutely find it space on the home server. Maybe using Rupeshs fastdcpu as the model and generation backend could work. I don't remember what his license is, though.

Edit: added link.

[–] Cr4yfish 10 points 1 month ago

Thanks! I'm already eyeing ollama for this.

[–] AliasAKA 14 points 1 month ago (1 children)

Is there any interest in getting local models to run using this? I’d rather not use Gemini, and then all the data can reside locally (and not require a login).

I’d be happy to work on this, though I’m a python developer not a typescript one.

[–] Cr4yfish 6 points 1 month ago (2 children)

Yeah, good idea. It's possible to do that with WebLLM & Langchain. Once Langchain is integrated, it's kinda similar to the Python Version so should be do-able I think.

load more comments (2 replies)
[–] [email protected] 12 points 1 month ago* (last edited 1 month ago) (1 children)

That sounds cool! Is there already a release? If not, don't rush it :)

Edit: never mind. I just saw the website 😅

[–] Cr4yfish 10 points 1 month ago (1 children)

Thanks :). Yeah, it's publicly accessible: nouv.app/. I use it daily already but it still has tons of bugs.

[–] [email protected] 2 points 1 month ago (1 children)

Unless I remove the "Always use secure connections" it breaks on the cert.

[–] Cr4yfish 5 points 1 month ago (2 children)

Hm that's very weird. I can't replicate it and I used some random SSL checker website and it checks out as well.

Really not sure why that's happening.

[–] [email protected] 4 points 1 month ago

WFM. Looks like you're using Let's Encrypt, which is fine, and everything seems to be consistent. I think you're good.

[–] [email protected] 3 points 1 month ago (1 children)

It's a great looking site at first glance (haven't signed up yet). I just sandboxed a browser and let it run without forcing HTTPS. Funny thing is that it does show it as being https when disabling https enforcement.

I'll take it for a spin this afternoon when I get back home (or in my phone when I get bores at the recital my wife is forcing me to go to 🤣🤣🤣).

load more comments (1 replies)
[–] [email protected] 10 points 1 month ago (1 children)
[–] Cr4yfish 4 points 1 month ago (1 children)
[–] [email protected] 4 points 1 month ago

Hope to see it growing the best way

[–] [email protected] 10 points 1 month ago* (last edited 1 month ago) (1 children)

@Cr4yfish nice project 🙂
I'm a bit worried about the AI part, though, as you'd want an app whose main purpose is "learning" to guarantee, if not the reliability of the material (since anyone can contribute), at least the reliability of the course generation process that it proposes.
As far as I know, this is not possible with current generative AI tools, so what's your plan to make sure hallucinations do not creep in?

[–] Cr4yfish 5 points 1 month ago

Thanks. My general strategy regarding GenAI and reducing the amount of hallucinations is by not giving it the task to make stuff up, but to just work on existing text - that's why I'm not allowing users to create content without source material.

However, LLMs will be LLMs and I've been testing it out a lot and found already multiple hallucinations. I built in a reporting system, although only reporting stuff works right now, not viewing reported questions.

That's my short term plan to get a good content quality, at least. I also want to move away from Vercel AI & Gemini to a Langchain Agent system or Graph maybe, which will increase the output Quality.

Maybe in some parallel Universe this really takes off and many people work on high quality Courses together...

[–] [email protected] 9 points 1 month ago (4 children)

Cool project! Is there any plans on releasing a mobile app in the future? I'm allergic to PWAs.

[–] Cr4yfish 12 points 1 month ago (5 children)

Thanks, haha. I'd love develop a Native App for it too but this is a zero-budget Project (aside from the Domain). PlayStore has a one-time fee so that's 25€ for Android + 8€/Month for the IOS AppStore just to have the App on there.

In theory, I could just have a downloadable .apk for Android to circumvent the fee but most people don't want to install a random .apk from the internet. And I'm not developing a Native App for like 3 people excluding myself (I'm an iPhone user).

Soo, yeah that'll probably not happen :(.

[–] [email protected] 16 points 1 month ago (1 children)

This post gathered a bit of traction. So hopefully more people help out. F droid is a better marketplace for oss compared to playstore because people downloading from playstore act entitles a little, especially towards oss software.

[–] Cr4yfish 3 points 1 month ago

Would be nice for sure... 0 forks yet.. but I'm hopeful :D

[–] [email protected] 12 points 1 month ago

In theory, I could just have a downloadable .apk for Android to circumvent the fee but most people don't want to install a random .apk from the internet.

You could've considered F-Droid.

Soo, yeah that'll probably not happen :(.

It's sad. Anyway, good luck with future development!

load more comments (3 replies)
[–] AliasAKA 8 points 1 month ago (2 children)

I personally love PWAs — why the hate for them? Personally I think more apps should be PWAs instead.

load more comments (2 replies)
load more comments (2 replies)
[–] [email protected] 6 points 1 month ago (1 children)
[–] Cr4yfish 6 points 1 month ago (2 children)

The UI mostly works offline once loaded in due to aggressive caching. Downloading Course Content was on the initial Roadmap but I removed it since I wasn't sure if anyone would like the feature.

Syncing stuff is a real pain in the ass but I'll implement it if at least a couple people want it.

[–] [email protected] 10 points 1 month ago (1 children)

An offline mode would definitely be something I would want, tho it isn't high priority.

[–] Cr4yfish 8 points 1 month ago

I added it back to the roadmap :).

[–] [email protected] 4 points 1 month ago (1 children)

I don't know how much of a subset I am, but I still use dictionary softwares from Windows 95~2000 era and Android softwares on a completely offline and vanilla VM, partly due to internet randomly going bad, and partly because I am neurotic about digital contents vanishing once support ends.

[–] Cr4yfish 3 points 1 month ago

Understandable. I added a proper offline mode back to the Roadmap on github.

[–] [email protected] 5 points 1 month ago (1 children)

How does the level creation from a pdf work and does it support languages other than English?

[–] Cr4yfish 8 points 1 month ago

I use Gemini, which supports PDF File uploads, combined with structured outputs to generate Course Sections, Levels & Question JSON.

When you upload a PDF, it first gets uploaded to a S3 Database directly from the Browser, which then sends the Filename and other data to the Server. The Server then downloads that Document from the S3 and sends it to Gemini, which then streams JSON back to the Browser. After that, the PDF is permanently deleted from the S3.

Data Privacy wise, I wouldn't upload anything sensitive since idk what Google does with PDFs uploaded to Gemini.

The Prompts are in English, so the output language is English as well. However, I actually only tested it with German Lecture PDFs myself.

So, yes, it probably works with any language that Gemini supports.

Here is the Source Code for the core function for this feature:

export async function createLevelFromDocument(
    { docName, apiKey, numLevels, courseSectionTitle, courseSectionDescription }: 
    { docName: string, apiKey: string, numLevels: number, courseSectionTitle: string, courseSectionDescription: string }) 
    {
    
    const hasCourseSection = courseSectionTitle.length > 0 && courseSectionDescription.length > 0;

    // Step 1: Download the PDF and get a buffer from it
    const blob = await downloadObject({ filename: docName, path: "/", bucketName: "documents" });
    const arrayBuffer = await blob.arrayBuffer();
    
    // Step 2: call the model and pass the PDF
    //const openai = createOpenAI({ apiKey: apiKey });
    const gooogle = createGoogleGenerativeAI({ apiKey: apiKey });

    const courseSectionsPrompt = createLevelPrompt({ hasCourseSection, title: courseSectionTitle, description: courseSectionDescription });
    
    const isPDF = docName.endsWith(".pdf");

    const content: UserContent = [];

    if(isPDF) {
        content.push(pdfUserMessage(numLevels, courseSectionsPrompt) as any);
        content.push(pdfAttatchment(arrayBuffer) as any);
    } else {
        const html = await blob.text();
        content.push(htmlUserMessage(numLevels, courseSectionsPrompt, html) as any);
    }

    const result = await streamObject({ 
        model: gooogle("gemini-1.5-flash"),
        schema: multipleLevelSchema,
        messages: [
            {
                role: "user",
                content: content
            }
        ]
    })
    

    return result;
}
[–] trashgirlfriend 4 points 1 month ago (1 children)
[–] Cr4yfish 6 points 1 month ago (1 children)

Haha. Well we can't all actually be Duolingo and employ people to create the courses :D

[–] trashgirlfriend 7 points 1 month ago (2 children)

It's all just flashcards with extra steps and anki already exists. /shrug

[–] [email protected] 3 points 1 month ago

I've made custom flashcards for anki to study stuff and I tested this for some similar things and it was a lot faster and easier. Anki feels like it takes forever so the investment to make a custom set is only worth it for things you need to study for a long time.

If all you want is to generate a bunch of flashcards fast and you have a pdf with the info presented clearly it's an easy method.

load more comments (1 replies)
[–] [email protected] 4 points 1 month ago (4 children)

Is it for self-host ppl too?

For all projects/apps, I am looking for OIDC, S3 and PgSQL. It's easier to implement these features earlier and these features will make any projects more popular in the self host community.

load more comments (4 replies)
load more comments
view more: next ›