Live data from Hacker News

IBM Granite: A Family of Open Foundation Models for Code Intelligence

github.com

51–60 of 78 posts

Re: IBM Granite: A Family of Open Foundation Models for Code Intelligence

#51
post #16

Earlier quoted context omitted.

Llama and Mistral are already local & fulfill these requirements

but who can you pay to run these models and fulfill these requirements /for you/ ;)

I could be wrong, but I think thats what the RHEL AI, topic was all about 24 hours ago ?

Re: IBM Granite: A Family of Open Foundation Models for Code Intelligence

#52

Earlier quoted context omitted.

What if I told you that a lot of freely licensed code on GitHub is not clean? That the authors may have read something and rewritten it in a way that wasn’t transformative? So it basically has the same problems.

What if I told you the supposedly clean "The Stack" dataset contains at least one GPL repository inside, just because their license detection tool bugged out? IBM and other big players are vigilant about these things, and this is what companies pay for. Their software may not be better in some metrics, but they're cleaner in some and their support contracts allows people to sleep tight at night. This is what money bu…

> IBM and other big players are vigilant about these things, and this is what companies pay for.

And more importantly, IBM will guarantee it in the case that they're wrong. _That's_ what companies pay for.

Re: IBM Granite: A Family of Open Foundation Models for Code Intelligence

#53

https://i.kym-cdn.com/photos/images/original/001/138/631/b7a...

Is this a segway for IBM to release Terraform specific LLMs so I never have to write that hot garbage ever again? Sign me up IBM!

just a heads up it's segue in the context you're using it

Re: IBM Granite: A Family of Open Foundation Models for Code Intelligence

#54
post #52

Earlier quoted context omitted.

What if I told you the supposedly clean "The Stack" dataset contains at least one GPL repository inside, just because their license detection tool bugged out? IBM and other big players are vigilant about these things, and this is what companies pay for. Their software may not be better in some metrics, but they're cleaner in some and their support contracts allows people to sleep tight at night. This is what money bu…

> IBM and other big players are vigilant about these things, and this is what companies pay for. And more importantly, IBM will guarantee it in the case that they're wrong. _That's_ what companies pay for.

Yes. I tucked it under "support contract" part mentally, actually.

Re: IBM Granite: A Family of Open Foundation Models for Code Intelligence

#56
post #55

I'm a complete newb when it comes to AI, and I am getting pretty ashamed of it too. How do I take a model like this and use it in my day to day? Can I somehow use in, say, VSCode? How do I point it at my code base, and use it to help me write new code?

You run most of these models in something that wraps them in an HTTP API. I use Ollama, which I think is the most popular but I’m not in a great position to judge. My impression is that it handles running models on CPU better.

So you’d basically install Ollama, download one of the versions of this model off HuggingFace, create a Modelfile since this isn’t in the default Ollama repo, and then Ollama can answer prompts with the model. Modelfiles are very simple, based on Dockerfiles. It takes like 15 seconds to make one if you aren’t messing with the various parameters.

Once it’s in Ollama, just get one of the various GPT plugins for VSCode and give it the Ollama URL (http://localhost:11434 by default). I use continue.dev but there are many.

Continue takes over the tab autocomplete with the LLM, and has a chat window on the right where you can use keyboard shortcuts to copy code into the prompt and ask it to edit/generate code or ask questions about existing code.

Re: IBM Granite: A Family of Open Foundation Models for Code Intelligence

#57
post #55

I'm a complete newb when it comes to AI, and I am getting pretty ashamed of it too. How do I take a model like this and use it in my day to day? Can I somehow use in, say, VSCode? How do I point it at my code base, and use it to help me write new code?

You run most of these models in something that wraps them in an HTTP API. I use Ollama, which I think is the most popular but I’m not in a great position to judge. My impression is that it handles running models on CPU better. So you’d basically install Ollama, download one of the versions of this model off HuggingFace, create a Modelfile since this isn’t in the default Ollama repo, and then Ollama can answer prompts…

Thank you so much! That sounds surprisingly straightforward. I expected a lot more fiddling to get going.

Where would I start if I wanted to use a model programmatically ? Like let's say I am building a chat bot. I have a large data set of replies I want the model to mimic, and I'd want to do this in Python. Of course, I'd probably use a different model than Granite.

Re: IBM Granite: A Family of Open Foundation Models for Code Intelligence

#58
post #57

Earlier quoted context omitted.

You run most of these models in something that wraps them in an HTTP API. I use Ollama, which I think is the most popular but I’m not in a great position to judge. My impression is that it handles running models on CPU better. So you’d basically install Ollama, download one of the versions of this model off HuggingFace, create a Modelfile since this isn’t in the default Ollama repo, and then Ollama can answer prompts…

Thank you so much! That sounds surprisingly straightforward. I expected a lot more fiddling to get going. Where would I start if I wanted to use a model programmatically ? Like let's say I am building a chat bot. I have a large data set of replies I want the model to mimic, and I'd want to do this in Python. Of course, I'd probably use a different model than Granite.

This is stretching my own knowledge, so if someone else knowledgeable wants to take a stab here I would appreciate a response as well!

Before doing that, I would start basic. Pull llama3 and see what it does with your prompts. You may be surprised how much is already in there and just not need to involve your own data at all. If that doesn’t work, check HuggingFace to see if someone has already made a model/fine tune/LoRA for what you’re trying to do. There are many, eg I found a Magic The Gathering rules model the other day.

If those fails, or you just want to play with your own data, you’ll need to figure out what “mimic” means.

If the model does okay with generating content but the content is factually wrong or missing background, you may be able to just do RAG (retrieval augmented generation). Basically running your documents through an AI that converts them to embeddings (some kind of vector, I don’t understand how they work). Then when you run a query, you can search for related embeddings and pass them to the model so that it “knows” the content that was in the document. This is the easiest; open-webui (the Ollama web chat interface) has some RAG support. Danswer is open source and built from the ground up to do RAG, and has built in support for ingesting from Slack, Drive, etc, etc. OpenAI also has embedding as a service.

A step up from that is making a LoRA. To my novice eyes, LoRA’s are basically a diff of the models parameters or weights. So rather than training a whole new model, you just add deltas to an existing one. These let you “teach” the model something while preserving the base generation capabilities of the underlying model. Ie you won’t have to worry about making sure you feed it enough data that it can speak English properly, because it gets that from the base model, you only have to give it enough data to speak about whatever you’re training it on.

If that doesn’t make any sense, go check CivitAI for Stable Diffusion (image model) LoRAs. The effects are way more obvious on image AIs.

Anyways, LoRAs are trained so you’re into training there. I think HuggingFace has tools that make this easy, but I don’t know enough to say anything with confidence.

The last option, which you almost certainly don’t want, is to train a new base model like llama3. You’re starting from 0 there; you have no existing model so you will have to teach it everything. It will take a ton of data, it will take forever to train, and it will likely be much worse than even randomly clicking models on HuggingFace. Meta has spent who knows how much on Llama and it still hallucinates.

If you end up training, you’ll probably end up doing it in the cloud unless you have tons of VRAM doing nothing. Prices are pretty reasonable, I think A100s are around $2/hr. I don’t know how to gauge how long it needs to train, but I believe it’s related to the amount of data you’re training on. I believe it’s pretty reasonable for LoRAs though, I’m guesstimating in the $20-ish range?

Edit: oh, and I’m not affiliated in any way, but I found out last night that Fireworks’ new function calling model is free while it’s in beta, which is a neat/fun thing to play with. https://fireworks.ai/blog/firefunction-v1-gpt-4-level-functi... it’s also open weights if you want to run it locally, but it’s a 40B model so I can’t on my 3060

Re: IBM Granite: A Family of Open Foundation Models for Code Intelligence

#59
post #57

Earlier quoted context omitted.

Thank you so much! That sounds surprisingly straightforward. I expected a lot more fiddling to get going. Where would I start if I wanted to use a model programmatically ? Like let's say I am building a chat bot. I have a large data set of replies I want the model to mimic, and I'd want to do this in Python. Of course, I'd probably use a different model than Granite.

This is stretching my own knowledge, so if someone else knowledgeable wants to take a stab here I would appreciate a response as well! Before doing that, I would start basic. Pull llama3 and see what it does with your prompts. You may be surprised how much is already in there and just not need to involve your own data at all. If that doesn’t work, check HuggingFace to see if someone has already made a model/fine tune…

Thank you again! This is definitely something to start from!

Re: IBM Granite: A Family of Open Foundation Models for Code Intelligence

#60
post #15

I wonder why companies like IBM are jumping on the LLM bandwagon and training/releasing models that have no chance of competing with Llama/Mistral? To me it just looks like a complete waste of $$ because nobody will use them in any serious scenarios

Enterprises think differently. They want data provenance, privacy, ability to mitigate/transfer risk etc. If IBM is willing to offer that, there will be enterprises that bite.

“Nobody was ever fired for hiring IBM”
Post reply on HN