├── .env.example ├── .gitignore ├── README.md ├── career_chat.jsonl ├── dataset.jsonl ├── example.js ├── package.json └── server.js /.env.example: -------------------------------------------------------------------------------- 1 | API_KEY=your_api_key 2 | FT_MODEL_ID=ft-123456789 -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .env 3 | .env.local 4 | package-lock.json 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Using OpenAI API to Build Your Own Fine Tuned Model 2 | 3 | ### Introduction 4 | 5 | OpenAI has an API that powers ChatGPT. But what if you wanted to use your OWN model? One that you've trained on your own data to answer questions based on previous answers. 6 | 7 | Can you imagine the possibilities? Custom chat bots? A resume assistant? A content creation generator? 8 | 9 | Let's get started. 10 | 11 | ### Prerequisites 12 | 13 | - Node.js installed 14 | - OpenAI API key https://platform.openai.com/ 15 | 16 | ### Steps to Get Started 17 | 18 | 1. **Environment Setup**: 19 | 20 | - Install the OpenAI Node.js package: `npm install openai`. 21 | - Set up your `.env` file with `API_KEY=your_openai_api_key`. 22 | 23 | 2. **Data Preparation**: 24 | 25 | - You can use the `example.js` file as a starting point to create your model. 26 | - Your data should be in JSONL format. Each line is a separate JSON object. Look at `career_chat.jsonl` as an example. 27 | - Use the `validateJSONL` function to ensure your data is in the correct format. 28 | 29 | 3. **Upload Dataset**: 30 | 31 | - Use the `uploadDataset` function to upload your JSONL file. This function will return a file ID. 32 | 33 | 4. **Fine-Tune the Model**: 34 | 35 | - Call `fineTuneModel` with the file ID from the previous step. 36 | - Wait for an email confirmation from OpenAI stating that fine-tuning is complete. 37 | 38 | 5. **Generate Completions**: 39 | - Use the `getModelCompletion` function with your fine-tuned model ID to generate completions. 40 | 41 | ### Video Walkthrough: 42 | 43 | https://www.loom.com/embed/2a08588964154ff48e00dc942100c375?sid=29572858-2a5a-40c0-97d2-90391dc9db08 44 | 45 | ### Use Cases 46 | 47 | - Building a chatbot for specific domains like career advice. 48 | - Creating a content generation tool tailored to your style or needs. 49 | - Enhancing customer support with automated, but personalized responses. 50 | 51 | ### Using Your Own Data 52 | 53 | - Format your data in JSONL format. 54 | - Ensure each line in your dataset represents a conversation or data point. 55 | - Use diverse examples to cover a wide range of scenarios. 56 | 57 | ### Steps to Create Your Own Model 58 | 59 | 1. Prepare your dataset in JSONL format. 60 | 2. Validate and upload your dataset using the provided functions. 61 | 3. Fine-tune the model with your dataset. 62 | 4. Test the model with the `getModelCompletion` function. 63 | 64 | Remember, fine-tuning allows you to tailor the OpenAI model to specific needs or domains, making your AI application more relevant and effective. 65 | -------------------------------------------------------------------------------- /career_chat.jsonl: -------------------------------------------------------------------------------- 1 | {"messages":[{"role":"system","content":"BrianBot: Conversation about the significance of impact in a resume."},{"role":"user","content":"What should I focus on when describing my projects on the resume?"},{"role":"assistant","content":"Highlight your impact rather than just the tasks you performed. Use a framework like [Thing you did] + [impact/metric] + [technology] to craft compelling statements. For example, instead of saying 'Built an e-commerce site,' you could say 'Implemented real-time inventory tracking on an e-commerce site, reducing order cancellations by 20%.'"}]} 2 | {"messages":[{"role":"system","content":"BrianBot: Conversation about leveraging leadership qualities."},{"role":"user","content":"How do I show I can take the lead in projects?"},{"role":"assistant","content":"Highlight instances where you’ve demonstrated leadership or autonomy. Rather than saying 'Worked with a team,' specify your role in leading or organizing a project or aspect of it. For instance, 'Organized and led front-end unit testing strategy, achieving 75% test coverage.' Teams are looking for candidates who can work autonomously, so showcasing leadership can make you a less risky hire."}]} 3 | {"messages":[{"role":"system","content":"BrianBot: Conversation about avoiding counter-intuitive information on a resume."},{"role":"user","content":"How should I organize the information on my resume?"},{"role":"assistant","content":"Go with a layout that makes it easy to find what's important. The order can be Summary, Skills, Projects/Experience, and then Education. However, you should lead with the most relevant area. If you have development experience from a volunteer job, that should be near the top. Use bold text to highlight numbers, achievements, and other areas you want the reader to focus on."}]} 4 | {"messages":[{"role":"system","content":"BrianBot: Conversation about decreasing the surface area for bias."},{"role":"user","content":"Is it necessary to mention my previous non-tech jobs on my resume?"},{"role":"assistant","content":"If the non-tech job doesn't contribute to the narrative that you're a strong candidate for a developer role, it might be best to leave it out. The goal is to decrease potential areas for bias. You want to come across as a 'safe bet' rather than someone they're taking a chance on."}]} 5 | {"messages":[{"role":"system","content":"BrianBot: Conversation about getting job-ready post-bootcamp."},{"role":"user","content":"What should I focus on after completing a coding bootcamp to get hired?"},{"role":"assistant","content":"After a coding bootcamp, your focus should be on building a strong portfolio and sharpening your interview skills. Work on meaningful side projects that you can discuss in depth. Practice technical interviews, and don’t shy away from networking. The idea is to stand out and be seen as a candidate who can add value from day one."}]} 6 | {"messages":[{"role":"system","content":"BrianBot: Conversation about avoiding the 'NO' pile in resume screening."},{"role":"user","content":"How can I make sure my resume doesn't end up in the 'NO' pile?"},{"role":"assistant","content":"You want to avoid generic or passive language that doesn't convey your impact. Instead of saying, 'Built a full-stack app,' go for something like, 'Led development for complex UI features, leading to increased user satisfaction.' This makes you look like a less risky hire and highlights your contributions effectively."}]} 7 | {"messages":[{"role":"system","content":"BrianBot: Conversation about optimizing resume layout."},{"role":"user","content":"Any tips for formatting my resume?"},{"role":"assistant","content":"Stick with a clean, simple layout. Avoid getting too fancy as your resume might get auto-formatted and become unreadable. Focus on the most relevant information: start with a brief summary that doesn't label you as 'junior,' followed by your skills and then projects/experience. Feel free to deviate from putting the most recent experience at the top if you have something more relevant to showcase."}]} 8 | {"messages":[{"role":"system","content":"BrianBot: Conversation about minimizing bias in the hiring process."},{"role":"user","content":"Should I mention that I'm a bootcamp grad or should I leave that out?"},{"role":"assistant","content":"If you believe that being a bootcamp grad could introduce bias against you, it may be better to leave it out. Focus instead on your skills, projects, and experiences that make you a solid candidate for the job. Remember, you don't want someone to take a chance on you; you want to be seen as a safe bet."}]} 9 | {"messages":[{"role":"system","content":"BrianBot: Conversation about the importance of having side projects."},{"role":"user","content":"Are side projects really important for getting hired?"},{"role":"assistant","content":"Yes, side projects are highly recommended. They not only help you learn and practice but also provide you with concrete examples of your work you can show to potential employers. Pick a project you're passionate about and make sure it showcases the skills that are relevant to the job you're aiming for."}]} 10 | {"messages":[{"role":"system","content":"BrianBot: Conversation about preparing for technical interviews."},{"role":"user","content":"What should I study for technical interviews?"},{"role":"assistant","content":"Focus on three main areas: technical skills, problem-solving ability, and communication skills. For technical skills, get comfortable with the languages you'll be using, data structures, and algorithms. Your problem-solving ability will generally be tested through coding challenges, so practice those as well. Finally, be prepared to effectively communicate your thought process and collaborate during pair programming exercises or whiteboard sessions."}]} 11 | {"messages":[{"role":"system","content":"BrianBot: Conversation about utilizing side projects to stand out."},{"role":"user","content":"Do side projects really matter for my resume?"},{"role":"assistant","content":"Absolutely, side projects can be a game-changer, especially if you're new to the field. They provide concrete examples of your skills and demonstrate your initiative. When describing them, focus on your impact and the technologies you used. It'll help you stand out, particularly if you lack formal work experience in tech."}]} 12 | {"messages":[{"role":"system","content":"BrianBot: Conversation about common mistakes in junior developer resumes."},{"role":"user","content":"What are the most common mistakes you see in junior developer resumes?"},{"role":"assistant","content":"Common mistakes include fluffy summaries, passive language, and listing tasks instead of impacts. Many junior devs also use counter-intuitive information organization. Make sure your resume is straightforward, highlights your contributions, and emphasizes your impact."}]} 13 | {"messages":[{"role":"system","content":"BrianBot: Conversation about dealing with lack of experience."},{"role":"user","content":"I don't have any work experience in tech. How can I make my resume stand out?"},{"role":"assistant","content":"Lack of formal work experience can be offset by showcasing meaningful side projects, contributions to open-source projects, or even volunteer tech work. Focus on demonstrating your impact and skills in these areas. Make sure to also mention any relevant coursework or certifications."}]} 14 | {"messages":[{"role":"system","content":"BrianBot: Conversation about the summary section of a resume."},{"role":"user","content":"Should I mention I'm a junior developer in my resume summary?"},{"role":"assistant","content":"Avoid labeling yourself as a 'junior' in the summary. It's better to focus on the skills and technologies you're familiar with. Use the summary to set a strong, confident tone for the rest of your resume."}]} 15 | {"messages":[{"role":"system","content":"BrianBot: Conversation about education section in a resume."},{"role":"user","content":"How important is the education section in a tech resume?"},{"role":"assistant","content":"Education can be a bonus but it's often not the deciding factor. If you have a degree that's relevant or prestigious, it could be a nice addition. Otherwise, focus more on your skills, projects, and experiences that demonstrate your aptitude for the job."}]} 16 | {"messages":[{"role":"system","content":"BrianBot: Conversation about job applications."},{"role":"user","content":"Is mass applying to jobs an effective strategy?"},{"role":"assistant","content":"Contrary to some advice out there, mass applying can work. However, while it may land you interviews, the quality of those opportunities may vary. Combining this approach with networking can yield better results."}]} 17 | {"messages":[{"role":"system","content":"BrianBot: Conversation about networking."},{"role":"user","content":"How important is networking in getting a tech job?"},{"role":"assistant","content":"Networking is extremely useful. It helps you get past the automated systems and directly into the consideration set of hiring managers. Don't underestimate the power of a referral or a simple LinkedIn connection."}]} 18 | {"messages":[{"role":"system","content":"BrianBot: Conversation about dealing with Impostor Syndrome."},{"role":"user","content":"I often feel like I'm not good enough for the jobs I'm applying for. How can I overcome this feeling?"},{"role":"assistant","content":"Impostor Syndrome is a challenge that almost every developer faces at some point. It's important to remember that confidence comes after you start, not before. List the skills you think you're lacking and make a plan to acquire them. You're probably more ready than you think."}]} 19 | {"messages":[{"role":"system","content":"BrianBot: Conversation about LinkedIn profiles."},{"role":"user","content":"How can I optimize my LinkedIn profile?"},{"role":"assistant","content":"To make your LinkedIn profile more discoverable, aim for at least 500 connections. Remove mentions of being a junior or student. Use strong language to describe your experiences and skills. Also, try to engage with the community by posting and commenting on relevant topics."}]} 20 | {"messages":[{"role":"system","content":"BrianBot: Conversation about choosing projects."},{"role":"user","content":"What kind of side projects should I focus on?"},{"role":"assistant","content":"Choose projects that you have an emotional attachment to, as it will keep you motivated. Make sure they're relevant to the jobs you're applying for. Stick to a tech stack you're familiar with, but also consider adding one or two new technologies to showcase your learning ability."}]} 21 | {"messages":[{"role":"system","content":"BrianBot: Conversation about resumes."},{"role":"user","content":"How can I make my resume stand out from the rest?"},{"role":"assistant","content":"To stand out, focus on impact over implementation. Describe what you did, the impact it had, and the technology you used. Use strong, active language and highlight your leadership or autonomous roles in projects. Keep the layout simple to avoid formatting issues."}]} 22 | {"messages":[{"role":"system","content":"BrianBot: Conversation about technical skills."},{"role":"user","content":"What technical skills should I focus on as a new developer?"},{"role":"assistant","content":"Focus on a core stack first—like JavaScript, HTML, CSS for front-end, or Python for back-end. As you gain confidence, add more specialized technologies like ReactJS or Node. TypeScript and unit testing are also highly recommended but often overlooked in educational settings."}]} 23 | {"messages":[{"role":"system","content":"BrianBot: Conversation about job market."},{"role":"user","content":"I hear the job market is saturated. Is it still a good time to enter tech?"},{"role":"assistant","content":"While competition exists, the demand for tech roles is still high. Don't let the 'saturated market' narrative deter you. With the right skills, networking, and a well-prepared resume, you'll find opportunities."}]} 24 | {"messages":[{"role":"system","content":"BrianBot: Conversation about interviews."},{"role":"user","content":"Any tips for technical interviews?"},{"role":"assistant","content":"For technical interviews, practice problem-solving using platforms like LeetCode but don't neglect system design and behavioral questions. Understanding the company's tech stack and projects can also give you an edge. And remember, it's okay to ask for clarification on questions during the interview."}]} 25 | {"messages":[{"role":"system","content":"BrianBot: Conversation about overcoming fear."},{"role":"user","content":"I'm afraid to start applying because I don't feel ready. What should I do?"},{"role":"assistant","content":"It's common to feel unprepared, but waiting for the 'right moment' might mean missed opportunities. Most people never feel 100% ready for a new challenge. Take the plunge, start applying, and learn as you go. Remember, confidence comes after you start."}]} 26 | -------------------------------------------------------------------------------- /dataset.jsonl: -------------------------------------------------------------------------------- 1 | {"messages":[{"role":"system","content":"Resume Review Assistant offering constructive criticism."},{"role":"user","content":"Should I list my years of experience at the start?"},{"role":"assistant","content":"Listing your years of experience at the start can set high expectations, so make sure the rest of your resume supports that level of expertise."}]} 2 | {"messages":[{"role":"system","content":"Resume Review Assistant offering constructive criticism."},{"role":"user","content":"Should I include my GitHub on my resume?"},{"role":"assistant","content":"Including your GitHub is fine, but be aware that a poor GitHub repository might deter recruiters from further considering your resume."}]} 3 | {"messages":[{"role":"system","content":"Resume Review Assistant offering constructive criticism."},{"role":"user","content":"How should I describe my technical projects?"},{"role":"assistant","content":"Use the formula: Feature built + Technology used + Benefit. This showcases not only what you've built but how it was useful."}]} 4 | {"messages":[{"role":"system","content":"Resume Review Assistant offering constructive criticism."},{"role":"user","content":"Should I mention why I joined a company?"},{"role":"assistant","content":"It's better to focus on what you achieved at the company rather than why you joined it."}]} 5 | {"messages":[{"role":"system","content":"Resume Review Assistant offering constructive criticism."},{"role":"user","content":"How should I format my resume?"},{"role":"assistant","content":"Use a standard word processor for formatting, as unconventional formats may not render properly on all systems."}]} 6 | {"messages":[{"role":"system","content":"Resume Review Assistant offering constructive criticism."},{"role":"user","content":"What should I put at the top of my LinkedIn profile?"},{"role":"assistant","content":"Start off with a strong introduction that summarizes your skills and experience, rather than asking for job opportunities."}]} 7 | {"messages":[{"role":"system","content":"Resume Review Assistant offering constructive criticism."},{"role":"user","content":"How should I order my skills on LinkedIn?"},{"role":"assistant","content":"Place your strongest and most relevant skills at the top to quickly catch the eye of recruiters or hiring managers."}]} 8 | {"messages":[{"role":"system","content":"Resume Review Assistant offering constructive criticism."},{"role":"user","content":"Should I comment on social media posts?"},{"role":"assistant","content":"Yes, engaging with industry influencers by leaving meaningful comments can increase your visibility and attract potential recruiters."}]} 9 | {"messages":[{"role":"system","content":"Resume Review Assistant offering constructive criticism."},{"role":"user","content":"Is it necessary to state that my experience list is 'selected'?"},{"role":"assistant","content":"It's not necessary and may create unnecessary room for bias. Simply use 'Professional Experience' as your heading."}]} 10 | {"messages":[{"role":"system","content":"Resume Review Assistant offering constructive criticism."},{"role":"user","content":"Should I include reasons for my interest in e-commerce on my resume?"},{"role":"assistant","content":"Focus more on your achievements and contributions rather than on what you hope to learn or gain. Employers are more interested in what you can bring to the company."}]} 11 | {"messages":[{"role":"system","content":"Resume Review Assistant offering constructive criticism."},{"role":"user","content":"Should I have two versions of my resume?"},{"role":"assistant","content":"Having two versions, one that highlights your professional experience and another that focuses on your technical projects, could be advantageous depending on the job you're applying for."}]} 12 | {"messages":[{"role":"system","content":"Resume Review Assistant offering constructive criticism."},{"role":"user","content":"Should I include commented-out code in my GitHub projects?"},{"role":"assistant","content":"It's better to clean up your code and remove unnecessary comments. They could be distracting for anyone reviewing your code."}]} 13 | {"messages":[{"role":"system","content":"Resume Review Assistant offering constructive criticism."},{"role":"user","content":"Is it bad to mention I have 8+ years of experience?"},{"role":"assistant","content":"Listing many years of experience can set high expectations. Ensure the rest of your resume and portfolio aligns with that level of expertise."}]} 14 | {"messages":[{"role":"system","content":"Resume Review Assistant offering constructive criticism."},{"role":"user","content":"How should I list my GitHub projects?"},{"role":"assistant","content":"Ensure your GitHub projects have a good readme file, clear structure, and quality code. A poor GitHub repo can hurt your chances as much as a good one can help."}]} 15 | {"messages":[{"role":"system","content":"Resume Review Assistant offering constructive criticism."},{"role":"user","content":"Should I include all my technical projects?"},{"role":"assistant","content":"Only include projects that are most relevant to the position you're applying for. The project descriptions should focus on features, technologies used, and the benefit of those projects."}]} 16 | {"messages":[{"role":"system","content":"Resume Review Assistant offering constructive criticism."},{"role":"user","content":"Should I mention the technologies I used in a project in my resume?"},{"role":"assistant","content":"Absolutely. Be specific about the technologies and frameworks you used, as this provides more context and shows your technical skills."}]} 17 | {"messages":[{"role":"system","content":"Resume Review Assistant offering constructive criticism."},{"role":"user","content":"What's the best file format for my resume?"},{"role":"assistant","content":"Word documents and Google Docs are generally better than other formats to avoid formatting issues during transmission."}]} 18 | {"messages":[{"role":"system","content":"Resume Review Assistant offering constructive criticism."},{"role":"user","content":"Is it important to mention the results of my work?"},{"role":"assistant","content":"Yes, quantifiable achievements can make your resume stand out. For example, 'Led to a 40% increase in unit tests and a decrease in bugs caught by users after launches.'"}]} 19 | {"messages":[{"role":"system","content":"Resume Review Assistant offering constructive criticism."},{"role":"user","content":"Should I list Dom and Firebase as my top skills?"},{"role":"assistant","content":"List your most proficient and job-relevant skills at the top. Dom and Firebase should only be at the top if they are most relevant to the jobs you're applying for."}]} 20 | {"messages":[{"role":"system","content":"Resume Review Assistant that offers constructive criticism based on the reviewer's opinions and approach."},{"role":"user","content":"How should I mention my years of experience?"},{"role":"assistant","content":"Be cautious when stating many years of experience as it sets high expectations. Make sure your skills and projects align with the experience you claim."}]} 21 | {"messages":[{"role":"system","content":"Resume Review Assistant that offers constructive criticism based on the reviewer's opinions and approach."},{"role":"user","content":"Should I include my GitHub on my resume?"},{"role":"assistant","content":"Yes, but be prepared. Your GitHub projects should be of good quality and well-documented. Poor or messy repositories can work against you."}]} 22 | {"messages":[{"role":"system","content":"Resume Review Assistant that offers constructive criticism based on the reviewer's opinions and approach."},{"role":"user","content":"Should my 'Professional Experience' section be at the top?"},{"role":"assistant","content":"Depending on your experience, you may choose to highlight professional experience or technical projects first. Either way, it should be well-formatted and concise."}]} 23 | {"messages":[{"role":"system","content":"Resume Review Assistant that offers constructive criticism based on the reviewer's opinions and approach."},{"role":"user","content":"What should I focus on when describing my projects?"},{"role":"assistant","content":"Discuss the features you built, the technologies you used, and the impact or benefit of the project. Frame it in a way that showcases your contributions."}]} 24 | {"messages":[{"role":"system","content":"Resume Review Assistant that offers constructive criticism based on the reviewer's opinions and approach."},{"role":"user","content":"Should I mention why I joined a company?"},{"role":"assistant","content":"No, focus on what you achieved there instead. Saying you joined to learn can create an impression that you were more of a beneficiary than a contributor."}]} 25 | {"messages":[{"role":"system","content":"Resume Review Assistant that offers constructive criticism based on the reviewer's opinions and approach."},{"role":"user","content":"Should I use Word or Google Docs for my resume?"},{"role":"assistant","content":"Word is recommended to avoid formatting issues. Some resumes lose their formatting when transferred and become unreadable."}]} 26 | {"messages":[{"role":"system","content":"Resume Review Assistant that offers constructive criticism based on the reviewer's opinions and approach."},{"role":"user","content":"How can I make my LinkedIn more appealing?"},{"role":"assistant","content":"Have a strong start in your summary, list your skills in order of proficiency, and engage with posts by influencers in your field to increase your visibility."}]} 27 | {"messages":[{"role":"system","content":"Resume Review Assistant that offers constructive criticism based on the reviewer's opinions and approach."},{"role":"user","content":"Should I comment on LinkedIn posts?"},{"role":"assistant","content":"Yes, commenting on posts, especially those from influencers in your field, can help you network and increase your visibility to potential employers."}]} 28 | {"messages":[{"role":"system","content":"Resume Review Assistant that offers constructive criticism based on the reviewer's opinions and approach."},{"role":"user","content":"What skills should I feature at the top on LinkedIn?"},{"role":"assistant","content":"Your most relevant and proficient skills should be at the top. Avoid listing generic or less impactful skills as your main focus."}]} 29 | {"messages":[{"role":"system","content":"Resume Review Assistant that offers constructive criticism based on the reviewer's opinions and approach."},{"role":"user","content":"Is it okay to have code comments in my GitHub projects?"},{"role":"assistant","content":"Absolutely, but they should be meaningful and not clutter the code. Comments should explain why a piece of code exists rather than what it's doing."}]} 30 | {"messages":[{"role":"system","content":"Resume Review Assistant that offers constructive criticism based on the reviewer's opinions and approach."},{"role":"user","content":"Should I use the word 'select' in the 'Professional Experience' section?"},{"role":"assistant","content":"It's not necessary. The word 'select' could introduce bias. Simply title the section 'Professional Experience'."}]} 31 | {"messages":[{"role":"system","content":"Resume Review Assistant that offers constructive criticism based on the reviewer's opinions and approach."},{"role":"user","content":"Should I mention the benefits of the projects I've worked on?"},{"role":"assistant","content":"Yes, explaining the impact or benefits of your projects can provide a fuller picture of your contributions and skills."}]} 32 | {"messages":[{"role":"system","content":"Resume Review Assistant that offers constructive criticism based on the reviewer's opinions and approach."},{"role":"user","content":"Should I mention my soft skills?"},{"role":"assistant","content":"Yes, but they should be relevant to the job you're applying for. Generic soft skills like 'communication' may be less impactful unless supported by specific examples."}]} 33 | {"messages":[{"role":"system","content":"Resume Review Assistant that offers constructive criticism based on the reviewer's opinions and approach."},{"role":"user","content":"How long should my resume be?"},{"role":"assistant","content":"Keep it to one page for less than 10 years of experience. For more than that, a maximum of two pages is acceptable."}]} 34 | {"messages":[{"role":"system","content":"Resume Review Assistant that offers constructive criticism based on the reviewer's opinions and approach."},{"role":"user","content":"Should I include a photo?"},{"role":"assistant","content":"Unless explicitly asked for or culturally expected, avoid including a photo. It could introduce bias."}]} 35 | {"messages":[{"role":"system","content":"Resume Review Assistant that offers constructive criticism based on the reviewer's opinions and approach."},{"role":"user","content":"Is it okay to have color on my resume?"},{"role":"assistant","content":"A little color is okay but keep it professional. Too much color could make your resume hard to read or seem less serious."}]} 36 | {"messages":[{"role":"system","content":"Resume Review Assistant that offers constructive criticism based on the reviewer's opinions and approach."},{"role":"user","content":"Should I list my certifications?"},{"role":"assistant","content":"Yes, but only if they are directly relevant to the job you're applying for. Listing irrelevant certifications can dilute the focus of your resume."}]} 37 | {"messages":[{"role":"system","content":"Resume Review Assistant that offers constructive criticism based on the reviewer's opinions and approach."},{"role":"user","content":"Do I need an 'Objective' section?"},{"role":"assistant","content":"It's optional. An objective can help if you're making a career change, but it can also be seen as filler. Make sure it adds value if you include it."}]} 38 | {"messages":[{"role":"system","content":"Resume Review Assistant that offers constructive criticism based on the reviewer's opinions and approach."},{"role":"user","content":"How do I show career progression?"},{"role":"assistant","content":"Use titles and dates effectively to indicate a growth trajectory, and highlight increasing levels of responsibility in your job descriptions."}]} 39 | {"messages":[{"role":"system","content":"Resume Review Assistant that offers constructive criticism based on the reviewer's opinions and approach."},{"role":"user","content":"Should I include hobbies?"},{"role":"assistant","content":"Only if they are highly relevant to the job or demonstrate a skill that's valuable in your field."}]} 40 | {"messages":[{"role":"system","content":"Resume Review Assistant that offers constructive criticism based on the reviewer's opinions and approach."},{"role":"user","content":"What file format should I use for my resume?"},{"role":"assistant","content":"PDF is usually the best choice to preserve formatting, unless the job description specifically requests another format."}]} 41 | {"messages":[{"role":"system","content":"Resume Review Assistant that offers constructive criticism based on the reviewer's opinions and approach."},{"role":"user","content":"Should I use bullet points or paragraphs?"},{"role":"assistant","content":"Bullet points are generally easier to skim, which is often beneficial given that recruiters typically spend very little time on each resume."}]} 42 | {"messages":[{"role":"system","content":"Resume Review Assistant that offers constructive criticism based on the reviewer's opinions and approach."},{"role":"user","content":"Can I include freelance work?"},{"role":"assistant","content":"Yes, freelance work is experience. Just be prepared to provide references or examples of your work."}]} 43 | {"messages":[{"role":"system","content":"Resume Review Assistant that offers constructive criticism based on the reviewer's opinions and approach."},{"role":"user","content":"Should I list my publications?"},{"role":"assistant","content":"Yes, particularly if you're in academia or a field where publications carry weight. Make sure to use a citation style appropriate for your field."}]} 44 | {"messages":[{"role":"system","content":"Resume Review Assistant that offers constructive criticism based on the reviewer's opinions and approach."},{"role":"user","content":"Do I include short-term jobs?"},{"role":"assistant","content":"It depends. Short-term jobs can be seen as a red flag, but they can also show a broad range of experience. If you include them, be prepared to explain them."}]} 45 | {"messages":[{"role":"system","content":"Resume Review Assistant that offers constructive criticism based on the reviewer's opinions and approach."},{"role":"user","content":"Is a skills bar chart a good idea?"},{"role":"assistant","content":"Avoid skills bar charts; they are often confusing and provide little meaningful information about your actual proficiency."}]} 46 | {"messages":[{"role":"system","content":"Resume Review Assistant that offers constructive criticism based on the reviewer's opinions and approach."},{"role":"user","content":"Should I list all programming languages I know?"},{"role":"assistant","content":"Only list languages that you are proficient in and are relevant to the job you are applying for. Listing too many can seem like a 'jack of all trades, master of none' situation."}]} 47 | {"messages":[{"role":"system","content":"Resume Review Assistant that offers constructive criticism based on the reviewer's opinions and approach."},{"role":"user","content":"Is it okay to list coursework?"},{"role":"assistant","content":"If you're a recent graduate or the coursework is highly specialized and relevant to the job, it can be beneficial to include it."}]} 48 | {"messages":[{"role":"system","content":"Resume Review Assistant that offers constructive criticism based on the reviewer's opinions and approach."},{"role":"user","content":"Should I include references?"},{"role":"assistant","content":"Generally, you should only provide references when asked. It's better to use the space on your resume to highlight your skills and experiences."}]} 49 | {"messages":[{"role":"system","content":"Resume Review Assistant that offers constructive criticism based on the reviewer's opinions and approach."},{"role":"user","content":"Is it okay to have a two-column resume?"},{"role":"assistant","content":"Two-column resumes can be effective, but be cautious as they can cause parsing issues with Applicant Tracking Systems (ATS)."}]} 50 | {"messages":[{"role":"system","content":"Resume Review Assistant that offers constructive criticism based on the reviewer's opinions and approach."},{"role":"user","content":"How do I handle gaps in my employment?"},{"role":"assistant","content":"Be honest but succinct. If the gaps were for professional growth like further study or a relevant project, do mention them."}]} 51 | {"messages":[{"role":"system","content":"Resume Review Assistant that offers constructive criticism based on the reviewer's opinions and approach."},{"role":"user","content":"Should I use jargon in my resume?"},{"role":"assistant","content":"Use industry-specific terms judiciously. While they can demonstrate your expertise, overuse can make your resume difficult to understand for non-specialists."}]} 52 | {"messages":[{"role":"system","content":"Resume Review Assistant that offers constructive criticism based on the reviewer's opinions and approach."},{"role":"user","content":"Do I need to include my GPA?"},{"role":"assistant","content":"Include your GPA only if it's strong and you're a recent graduate. For most experienced roles, a GPA is irrelevant."}]} 53 | {"messages":[{"role":"system","content":"Resume Review Assistant that offers constructive criticism based on the reviewer's opinions and approach."},{"role":"user","content":"Should I include a 'Summary' section?"},{"role":"assistant","content":"A summary section can be effective if it's well-written and offers a quick snapshot of your qualifications. Avoid generic and fluffy statements."}]} 54 | {"messages":[{"role":"system","content":"Resume Review Assistant that offers constructive criticism based on the reviewer's opinions and approach."},{"role":"user","content":"How do I write a resume for a career switch?"},{"role":"assistant","content":"Focus on transferable skills and relevant experiences, even if they're from a different field. Tailor your 'Objective' or 'Summary' to explain the switch."}]} 55 | {"messages":[{"role":"system","content":"Resume Review Assistant that offers constructive criticism based on the reviewer's opinions and approach."},{"role":"user","content":"Should I include volunteer work?"},{"role":"assistant","content":"Yes, especially if the volunteer work demonstrates skills relevant to the job or fills an employment gap."}]} 56 | {"messages":[{"role":"system","content":"Resume Review Assistant that offers constructive criticism based on the reviewer's opinions and approach."},{"role":"user","content":"Should I include high school education?"},{"role":"assistant","content":"Unless you're a recent high school graduate, it's usually best to focus on more recent and relevant educational experiences."}]} 57 | {"messages":[{"role":"system","content":"Resume Review Assistant that offers constructive criticism based on the reviewer's opinions and approach."},{"role":"user","content":"Can I use humor in my resume?"},{"role":"assistant","content":"It's risky. What one person finds amusing, another might find unprofessional. It's generally safer to maintain a formal tone."}]} 58 | -------------------------------------------------------------------------------- /example.js: -------------------------------------------------------------------------------- 1 | require('dotenv').config(); 2 | 3 | const OpenAI = require('openai'); 4 | 5 | const fs = require('fs'); 6 | 7 | const readline = require('readline'); 8 | 9 | const openai = new OpenAI({ apiKey: process.env.API_KEY }); 10 | 11 | async function validateJSONL(file) { 12 | const fileStream = fs.createReadStream(file); 13 | 14 | const rl = readline.createInterface({ 15 | input: fileStream, 16 | 17 | crlfDelay: Infinity, 18 | }); 19 | 20 | let lineNumber = 0; 21 | 22 | for await (const line of rl) { 23 | lineNumber++; 24 | 25 | try { 26 | JSON.parse(line); 27 | } catch (e) { 28 | console.error( 29 | `Invalid JSON object at line ${lineNumber}: ${e.message}` 30 | ); 31 | 32 | return false; 33 | } 34 | } 35 | 36 | console.log('File is a valid JSONL file'); 37 | 38 | return true; 39 | } 40 | 41 | async function uploadDataset() { 42 | if (await validateJSONL('career_chat.jsonl')) { 43 | const status = await openai.files.create({ 44 | file: fs.createReadStream('careerchat.jsonl'), 45 | 46 | purpose: 'fine-tune', 47 | }); 48 | 49 | console.log(status); 50 | 51 | return status.id; 52 | } 53 | 54 | return null; 55 | } 56 | 57 | async function fineTuneModel(trainingFileId) { 58 | const fineTune = await openai.fineTuning.jobs.create({ 59 | training_file: trainingFileId, 60 | 61 | model: 'gpt-3.5-turbo', 62 | }); 63 | 64 | console.log(fineTune); 65 | 66 | // Wait for the email confirmation that the fine-tuning is complete before proceeding. 67 | } 68 | 69 | async function getModelCompletion(modelId) { 70 | const completion = await openai.chat.completions.create({ 71 | messages: [ 72 | { 73 | role: 'user', 74 | 75 | content: 76 | 'should i include previous work experience on my resume not related to tech?', 77 | }, 78 | ], 79 | 80 | model: modelId, 81 | }); 82 | 83 | console.log(completion.choices[0].message.content); 84 | } 85 | 86 | // Uncomment the function you want to run based on the step you're at: 87 | 88 | // uploadDataset(); // Step 1: Upload the dataset 89 | 90 | // fineTuneModel('YOUR_FILE_ID'); // Step 2: Fine-tune the model. Replace 'YOUR_FILE_ID' with the file ID from the previous step. 91 | 92 | // getModelCompletion('YOUR_FINE_TUNED_MODEL_ID'); // Step 3: Get a completion. Replace 'YOUR_FINE_TUNED_MODEL_ID' with the model ID from the email. 93 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "js_pros_llm", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "server.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "dotenv": "^16.3.1", 14 | "express": "^4.18.2", 15 | "openai": "^4.7.1" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /server.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const OpenAI = require('openai'); 3 | require('dotenv').config(); 4 | 5 | const openai = new OpenAI({ apiKey: process.env.API_KEY }); 6 | 7 | const app = express(); 8 | const port = 3000; 9 | 10 | // Middleware to parse JSON bodies 11 | app.use(express.json()); 12 | 13 | app.post('/chat', async (req, res) => { 14 | try { 15 | const userQuery = req.body.message; // Get user message from request body 16 | const completion = await openai.chat.completions.create({ 17 | messages: [ 18 | { 19 | role: 'user', 20 | content: userQuery, 21 | }, 22 | ], 23 | model: process.env.FT_MODEL_ID, // Use your fine-tuned model ID 24 | }); 25 | 26 | res.send(completion.choices[0]); // Send the response back to the client 27 | } catch (error) { 28 | console.error(error); 29 | res.status(500).send('Error processing your request'); 30 | } 31 | }); 32 | 33 | app.listen(port, () => { 34 | console.log(`Server running on http://localhost:${port}`); 35 | }); 36 | --------------------------------------------------------------------------------