Powering Cody Coding Assistant Using LLMs

Rate this content
Bookmark

FAQ

Rishabh is the head of AI at SourceCraft.

Rishabh's talk covers four main themes: what coding assistants do, the stack and its problems (context, models, evaluation), the future of code AI, and complex task automation.

Cody is a coding assistant that lives in your browser or integrated development environment (IDE) like VSCode, JetBrains, or Eclipse. It helps developers be more productive by offering features like autocomplete, chat about repositories, unit test generation, code explanation, and code smell detection.

Cody offers features such as autocomplete, chatting about repositories, unit test generation, code explanation, code smell detection, security and vulnerability detection, and custom commands.

The main problems faced by coding assistants include understanding and retrieving the right context, model performance and latency trade-offs, and evaluating the effectiveness of these systems.

The "big code" problem refers to the challenge of understanding and searching through large codebases, such as those in a Fortune 500 company, which may have millions of lines of code and thousands of repositories.

Cody handles context by fetching relevant pieces of code from the current repository, other repositories in the organization, and potentially all code the user has access to, to help generate accurate code completions and answers.

Component-specific evaluations focus on individual parts of the system, such as context retrieval or model performance, while end-to-end evaluations assess the overall effectiveness of the coding assistant in helping the user.

Cody uses smaller machine learning models for tasks requiring low latency, such as code completions, to ensure responses are generated within 300-400 milliseconds.

The future direction for code AI includes moving towards agent-led frameworks and eventually achieving full autonomy in coding tasks. This involves breaking down complex tasks into subtasks, planning, and reinforcement learning.

Rishabh Mehrotra
Rishabh Mehrotra
29 min
15 Jun, 2024

Comments

Sign in or register to post your comment.

Video Summary and Transcription

This Talk explores the world of coding assistants powered by language models (LLMs) and their use cases in software development. It delves into challenges such as understanding big code and developing models for context in LLMs. The importance of ranking and code context is discussed, along with the use of weak supervision signals and fine-tuning models for code completion. The Talk also touches on the evaluation of models and the future trends in code AI, including automation and the role of tasks, programming languages, and code context.

1. Introduction to Coding Assistants

Short description:

Today, we're going to talk about what kind of ML problems we face, the components of the system, and how to evaluate and consider the context. We'll also discuss the stack, problems in the context, models, evaluation, and nuances. Finally, we'll summarize the current state of code AI and explore the future, as well as touch on complex task automation.

Cool. Good evening, everyone. Thanks for coming back. Thanks for sticking around. It's like a sparse room. Hopefully people chime in.

So my name is Rishabh. This introduction was dated because I was working with personalization, and now I'm working on generative ML. I'm the head of AI at SourceCraft.

Just a quick raise of hands, how many of you are aware of Cody? A few? Okay. Nice. How many of you are using any coding assistant, including Copilot or Cody? A few. Nice, great. So, yes, today we're going to talk a bunch about what kind of ML problems do we face, high level, what are the different components of the system and how do we evaluate this, how do we think about context around this, essentially.

A quick background. I grew up in India. I was doing my PhD in search and recommendations. I was at Spotify looking at music recommendations, multi-objective decisioning, and recently I'm working on code ML. So I come in from a machine learning background and applying it to media recommendations and now coding as a domain.

So today we're going to talk about four main themes. Five minutes each, approximately. So we're going to start by talking about overall what coding assistants do. This is similar to what Cody and Copilot and others do, but I'm going to mention one or two nuances about these problems. We're going to spend most of the time talking about what does the stack look like, what are the problems in the context, what are the problems in the models, what are the problems in the evaluation and what are the nuances over there? Towards the end of the last five to eight minutes, I'm going to summarize where we are headed. What are the levels of code AI look like? Where are we right now, what we think could be coming in the future and then overall my favourite topic, complex task automation, and just sharing some thoughts about that.

Cool. So if you start with Cody, then Cody is a coding assistant. It lives in your browser, in your ID. So if you're looking at VSCode, JetBrains, Eclipse, any of these IDs you're working with, so it's kind of a coding assistant which helps you be a better productive developer. And especially what that means is we have features like autocomplete which says that if you're writing code, then we can help you write code faster.

2. Coding Assistants: Use Cases and Problem Areas

Short description:

You can code faster using LLMs by utilizing completion, chat, unit test generation, explain code, code smells, security and vulnerability detection, and custom commands. These are the use cases people are currently using Coddy for. We'll discuss the overlapping problems and three main areas: context, models, and evaluation.

So you can code faster using LLMs. An example here would be that, hey, I'm writing code, but I'm writing code in a big repository. So there's a context about what I'm trying to do. And it's not just about this file, there's some other context in some other part of the repository or maybe some other repositories as well. You start to write the correct completion. Suggest that. And when you're suggesting, you can make a single line completion or a multiline completion as well. And then the latencies and all kind of factor in over there. So this is what completion looks like.

You can also chat about repositories, about your code. Imagine you're a new developer on a team and you want to understand what this code base is about. So then you'll go in and say, hey, tell me about what this is. Or if I want to do this, just chat about your code base, essentially. You can also start looking at unit test generation. And the problem would be that I select a piece of code and then I can go to Coddy and say, can you please generate a unit test for this? You can also look at explain code. And you can say just get up to speed. Similar to chat, but a bit more explanation centric. You can also look at code smells. So code smells is find me ways in which I can optimize this code a bit more. You can also extend it to security and vulnerability detection and a bunch of those. And the list goes on. You can create custom commands as well, which means that if there is something which you do ten times in a day, might as well create a custom command and let Coddy do that for you. So these are the use cases which right now people are using Coddy for. Now the question then becomes what does it take to build this? And what are we talking about? And part of this, 70% of this is overlapping with not just coding assistant, but also any co-pilot you see out there in the world. Even if it's a sales co-pilot, marketing co-pilot, risk analyst, all these people trying to develop these agents to help some developers across in the industry. So most of these problems are pretty common over there as well. So we're going to talk about three problems here. The context, the models, and evaluation. And all of these are super important. And this is not the first time we are seeing it.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

React Compiler - Understanding Idiomatic React (React Forget)
React Advanced Conference 2023React Advanced Conference 2023
33 min
React Compiler - Understanding Idiomatic React (React Forget)
Top Content
Watch video: React Compiler - Understanding Idiomatic React (React Forget)
Joe Savona
Mofei Zhang
2 authors
The Talk discusses React Forget, a compiler built at Meta that aims to optimize client-side React development. It explores the use of memoization to improve performance and the vision of Forget to automatically determine dependencies at build time. Forget is named with an F-word pun and has the potential to optimize server builds and enable dead code elimination. The team plans to make Forget open-source and is focused on ensuring its quality before release.
Speeding Up Your React App With Less JavaScript
React Summit 2023React Summit 2023
32 min
Speeding Up Your React App With Less JavaScript
Top Content
Watch video: Speeding Up Your React App With Less JavaScript
Mishko, the creator of Angular and AngularJS, discusses the challenges of website performance and JavaScript hydration. He explains the differences between client-side and server-side rendering and introduces Quik as a solution for efficient component hydration. Mishko demonstrates examples of state management and intercommunication using Quik. He highlights the performance benefits of using Quik with React and emphasizes the importance of reducing JavaScript size for better performance. Finally, he mentions the use of QUIC in both MPA and SPA applications for improved startup performance.
SolidJS: Why All the Suspense?
JSNation 2023JSNation 2023
28 min
SolidJS: Why All the Suspense?
Top Content
Suspense is a mechanism for orchestrating asynchronous state changes in JavaScript frameworks. It ensures async consistency in UIs and helps avoid trust erosion and inconsistencies. Suspense boundaries are used to hoist data fetching and create consistency zones based on the user interface. They can handle loading states of multiple resources and control state loading in applications. Suspense can be used for transitions, providing a smoother user experience and allowing prioritization of important content.
From GraphQL Zero to GraphQL Hero with RedwoodJS
GraphQL Galaxy 2021GraphQL Galaxy 2021
32 min
From GraphQL Zero to GraphQL Hero with RedwoodJS
Top Content
Tom Pressenwurter introduces Redwood.js, a full stack app framework for building GraphQL APIs easily and maintainably. He demonstrates a Redwood.js application with a React-based front end and a Node.js API. Redwood.js offers a simplified folder structure and schema for organizing the application. It provides easy data manipulation and CRUD operations through GraphQL functions. Redwood.js allows for easy implementation of new queries and directives, including authentication and limiting access to data. It is a stable and production-ready framework that integrates well with other front-end technologies.
Jotai Atoms Are Just Functions
React Day Berlin 2022React Day Berlin 2022
22 min
Jotai Atoms Are Just Functions
Top Content
State management in React is a highly discussed topic with many libraries and solutions. Jotai is a new library based on atoms, which represent pieces of state. Atoms in Jotai are used to define state without holding values and can be used for global, semi-global, or local states. Jotai atoms are reusable definitions that are independent from React and can be used without React in an experimental library called Jotajsx.
Building a Voice-Enabled AI Assistant With Javascript
JSNation 2023JSNation 2023
21 min
Building a Voice-Enabled AI Assistant With Javascript
Top Content
This Talk discusses building a voice-activated AI assistant using web APIs and JavaScript. It covers using the Web Speech API for speech recognition and the speech synthesis API for text to speech. The speaker demonstrates how to communicate with the Open AI API and handle the response. The Talk also explores enabling speech recognition and addressing the user. The speaker concludes by mentioning the possibility of creating a product out of the project and using Tauri for native desktop-like experiences.

Workshops on related topic

AI on Demand: Serverless AI
DevOps.js Conf 2024DevOps.js Conf 2024
163 min
AI on Demand: Serverless AI
Top Content
Featured WorkshopFree
Nathan Disidore
Nathan Disidore
In this workshop, we discuss the merits of serverless architecture and how it can be applied to the AI space. We'll explore options around building serverless RAG applications for a more lambda-esque approach to AI. Next, we'll get hands on and build a sample CRUD app that allows you to store information and query it using an LLM with Workers AI, Vectorize, D1, and Cloudflare Workers.
Leveraging LLMs to Build Intuitive AI Experiences With JavaScript
JSNation 2024JSNation 2024
108 min
Leveraging LLMs to Build Intuitive AI Experiences With JavaScript
Featured Workshop
Roy Derks
Shivay Lamba
2 authors
Today every developer is using LLMs in different forms and shapes, from ChatGPT to code assistants like GitHub CoPilot. Following this, lots of products have introduced embedded AI capabilities, and in this workshop we will make LLMs understandable for web developers. And we'll get into coding your own AI-driven application. No prior experience in working with LLMs or machine learning is needed. Instead, we'll use web technologies such as JavaScript, React which you already know and love while also learning about some new libraries like OpenAI, Transformers.js
Llms Workshop: What They Are and How to Leverage Them
React Summit 2024React Summit 2024
66 min
Llms Workshop: What They Are and How to Leverage Them
Featured Workshop
Nathan Marrs
Haris Rozajac
2 authors
Join Nathan in this hands-on session where you will first learn at a high level what large language models (LLMs) are and how they work. Then dive into an interactive coding exercise where you will implement LLM functionality into a basic example application. During this exercise you will get a feel for key skills for working with LLMs in your own applications such as prompt engineering and exposure to OpenAI's API.
After this session you will have insights around what LLMs are and how they can practically be used to improve your own applications.
Table of contents: - Interactive demo implementing basic LLM powered features in a demo app- Discuss how to decide where to leverage LLMs in a product- Lessons learned around integrating with OpenAI / overview of OpenAI API- Best practices for prompt engineering- Common challenges specific to React (state management :D / good UX practices)
Working With OpenAI and Prompt Engineering for React Developers
React Advanced Conference 2023React Advanced Conference 2023
98 min
Working With OpenAI and Prompt Engineering for React Developers
Top Content
Workshop
Richard Moss
Richard Moss
In this workshop we'll take a tour of applied AI from the perspective of front end developers, zooming in on the emerging best practices when it comes to working with LLMs to build great products. This workshop is based on learnings from working with the OpenAI API from its debut last November to build out a working MVP which became PowerModeAI (A customer facing ideation and slide creation tool).
In the workshop they'll be a mix of presentation and hands on exercises to cover topics including:
- GPT fundamentals- Pitfalls of LLMs- Prompt engineering best practices and techniques- Using the playground effectively- Installing and configuring the OpenAI SDK- Approaches to working with the API and prompt management- Implementing the API to build an AI powered customer facing application- Fine tuning and embeddings- Emerging best practice on LLMOps
Building AI Applications for the Web
React Day Berlin 2023React Day Berlin 2023
98 min
Building AI Applications for the Web
Workshop
Roy Derks
Roy Derks
Today every developer is using LLMs in different forms and shapes. Lots of products have introduced embedded AI capabilities, and in this workshop you’ll learn how to build your own AI application. No experience in building LLMs or machine learning is needed. Instead, we’ll use web technologies such as JavaScript, React and GraphQL which you already know and love.
Building Your Generative AI Application
React Summit 2024React Summit 2024
82 min
Building Your Generative AI Application
WorkshopFree
Dieter Flick
Dieter Flick
Generative AI is exciting tech enthusiasts and businesses with its vast potential. In this session, we will introduce Retrieval Augmented Generation (RAG), a framework that provides context to Large Language Models (LLMs) without retraining them. We will guide you step-by-step in building your own RAG app, culminating in a fully functional chatbot.
Key Concepts: Generative AI, Retrieval Augmented Generation
Technologies: OpenAI, LangChain, AstraDB Vector Store, Streamlit, Langflow