Thursday, March 27, 2025

How to price for B2B - podcast summary

Listen to the complete episode of Y Combinator's Startup School podcast: How to Price for B2B. The downloadable audio episode is available here, and the archive can be found here.

For my own convenience, here are the podcast summary and full transcript ...

Podcast summary

Chapter 1: Introduction to Pricing Challenges for Founders

  • Timestamp: 00:00:01 - 00:01:13
  • Summary: The discussion begins with a common issue founders face: determining pricing for their products. It highlights a scenario where, after a successful sales call, a founder struggles to respond when asked for pricing due to inexperience with corporate software costs. Founders often suggest low prices like $19 or $49 per month, based on personal software purchases, undervaluing their product compared to business norms.
  • Key Points:
    • Founders lack calibration for pricing without exposure to large company software costs.
    • Lowball pricing (e.g., $19/month) feels comfortable but is unrealistic for B2B software.
    • Asking for higher prices (e.g., tens or hundreds of thousands) feels daunting initially.

Chapter 2: The Value Equation - Core Pricing Strategy

  • Timestamp: 00:01:13 - 00:04:14
  • Summary: The "value equation" is presented as the cornerstone of pricing. It involves working with the customer’s champion to quantify the product’s value—such as cost savings, time savings, or revenue growth. An example illustrates an AI customer service tool saving 20% of a $10 million budget ($2 million), with pricing set at 25-50% of that value (e.g., $700,000). This method also defines success metrics for pilot projects.
  • Key Points:
    • Collaborate with the champion to define and validate value (e.g., $2 million in savings).
    •  Set pricing at 25-50% of delivered value for mutual benefit (e.g., $700,000 for $2 million savings).
    • Use the value equation to establish pilot success metrics (e.g., 20% query reduction).

Chapter 3: Considering Costs as a Pricing Floor

  • Timestamp: 00:04:14 - 00:06:17
  • Summary: Costs are addressed as a secondary factor, serving as a pricing floor rather than the starting point. "Cost-plus" pricing is discouraged as it leads to underpricing, with a recommendation to target 80-90% software margins. Temporary credits (e.g., from AWS or Open AI) should be treated as cash costs, and pricing below cost is flagged as risky, though falling AI costs might justify it in specific cases.
  • Key Points:
    •  Use costs as a floor, not a base (e.g., $200,000 cost vs. $700,000 price).
    •  Aim for 80-90% margins; pricing below cost is unsustainable without significant future reductions.
    • Avoid relying on credits; low-price strategies are risky unless costs will drop dramatically.

Chapter 4: Handling Competition in Pricing

  • Timestamp: 00:06:17 - 00:07:48
  • Summary: The challenge of competitors underpricing is explored, with a warning against price wars that erode margins in a "race to the bottom." Instead, differentiation through unique features or value is advised. The airline industry, with its 2.7% profit margin, serves as a cautionary tale of commoditization, emphasizing the need to stand out.
  • Key Points:
    • Avoid price wars; undercutting competitors harms sustainability.
    • Differentiate the product to avoid direct comparisons (e.g., unique functionality).
    • Commodity markets (e.g., airlines) show how lack of differentiation squeezes margins.

Chapter 5: Pricing Structures and Customer Preferences

  • Timestamp: 00:07:48 - 00:09:49
  • Summary: Pricing structures are examined, with a suggestion to ask champions about payment norms for similar software (e.g., flat fees, per-seat, usage-based). Simple, familiar options like monthly or annual recurring revenue (MRR/ARR) are favored over complex usage-based models, which risk revenue drops in downturns. Starting with usage-based pricing and converting to flat fees with discounts is also proposed.
  • Key Points:
    • Align with industry-standard pricing (e.g., flat fees, per-seat) for ease of adoption.
    • Prefer MRR/ARR for stability over uncapped usage-based pricing.
    • Shift from usage-based to flat fees (e.g., $15,000 usage to $12,000 flat) with commitments.

Chapter 6: Practical Pricing Tips and Enterprise Considerations

  • Timestamp: 00:09:49 - 00:11:46
  • Summary: Practical advice includes setting pilot pricing below a champion’s approval threshold (e.g., $14,999 for a $15,000 limit) to speed up sales. Publishing fixed prices online is debated, as it can miss value variations, with tiered plans (e.g., basic vs. enterprise with compliance features) recommended to segment customers effectively.
  • Key Points:
    • Price pilots just under approval limits (e.g., $14,999) for quick decisions.
    • Avoid fixed public prices for enterprises; tailor via “contact sales” for value-based pricing.
    • Use tiered plans, gating enterprise features (e.g., SSO, compliance) for higher rates.

Chapter 7: Sales Channels and Free Trials

  • Timestamp: 00:11:46 - 00:14:31
  • Summary: Pricing’s impact on sales channels is analyzed using a 5:1 ARR-to-compensation ratio (e.g., $500,000 ARR per $100,000 salesperson). High-value contracts fit account executives, while low-value deals suit inside sales or self-service. Long free trials are discouraged; short pilots with clear metrics or annual contracts with money-back guarantees are preferred.
  • Key Points:
    • Pricing shapes sales: $500,000 ARR could be 1x $500,000 or 42x $1,000 deals.
    • Limit pilots to 2-4 weeks with value metrics; favor annual contracts with opt-outs.
    • High pricing supports sales teams; low pricing leans toward self-service or call centers.

Chapter 8: Startup Advantages and Iterative Pricing

  • Timestamp: 00:14:31 - 00:16:28
  • Summary: Pretending to be a larger company is discouraged; instead, startups should emphasize strengths like direct founder access. If the value equation is unclear, starting with a baseline price (e.g., $10,000) and increasing by 50% per pitch (e.g., $15,000, $22,000) is suggested, adjusting when 25% of deals are lost to price, prioritizing experimentation early on.
  • Key Points:
    • Leverage startup agility (e.g., 24/7 founder support) over faking scale.
    • Test pricing: start low, raise by 50% per pitch, stop at 25% deal loss rate.
    • Early pricing is less critical long-term; focus on closing deals and refining later.

Chapter 9: Conclusion and Recap

  • Timestamp: 00:16:28 - 00:17:27
  • Summary: The three key pricing elements are reiterated: the value equation (pricing at ~33% of value), ensuring costs don’t exceed price, and differentiating from competitors. Pricing is framed as an evolving process, improving with experience, customer validation, and product enhancements, with a call to start selling and adjust over time.
  • Key Points:
    • Core pricing: Value equation (~33% of value), cost as a floor, differentiate from competition.
    • Begin selling, even imperfectly; early customers are a small share of future revenue.
    • Pricing refines with sales practice, customer logos, and product improvements.

Full transcript

00:00:01    [Music] hi there my name is Tom and I'm a partner here at y combinator today I'm going to be talking about one of the most common questions I get from Founders which is how to price so the Founder's been working on outbound sales contacting people and they finally had a sales call that went really really well the champion that's the person the customer who's uh potentially buying is really really interested in in the product and asked us for pricing and we just froze what number should we pick often when you haven't worked at a big

00:00:41    company you don't have good calibration about what kind of prices these companies tend to pay for software and so you might think of the last time you bought software you know a subscription to GitHub or chat GPT and you pick a ludicrously no low number $19 a month or $49 a month or something like that because for Founders who have spent the last two or three months building a product asking for tens or even hundreds of thousands of dollars can feel very uncomfortable you almost can't say it with a straight face and so what I'm

00:01:13    going to talk about today is a way to to come up with a price and justify that price to your customer so there are three core elements here and by far the most important is what I call the value equation so this is the idea that you sit down uh with your with your Champion that's the person at the customer that's really into your product that perhaps sees it's going to solve one of their biggest problems and you write down with this Champion uh what they expect your product to do for them what value it's

00:01:44    going to deliver uh to their company that might be a cost saving it might be a time saving or an increase in revenue and you've got to write this down step by step and then get the customer to challenge it to produ it and really make sure the assumptions are correct because ultimately it's a tool for that person to take to their boss or their CFO to justify the purchase of this contract so we're going to walk through a quick example here say you're selling a I don't know a customer service tool to a

00:02:12    big company that has a c 100 customer support agents and maybe just for the sake of argument uh each customer support agent is paid $50,000 a year in salaries and then there's another $50,000 uh per employee in additional costs that might be offices overheads health insurance all that stuff so so the fully loaded cost of each customer service person is $100,000 and they've got a hundred of them so that's $10 million of total customer service cost and say we're going in to this customer saying we've

00:02:42    got this new AI powered customer service tool that will eliminate 20% of the queries or 20% of the total time spent by that customer service team that's $2 million of potential cost saving and so again remember you're normally saving time which is cost or reducing cost directly or increasing Revenue those are typically the three things that companies care about so once you've established what value you're delivering the pricing is pretty simple I typically pick somewhere between 25 and 50% of the

00:03:14    value you're delivering so they keep roughly 2/3 you keep roughly a third so our previous example $2 million of savings uh they keep 1.3 you charge them maybe 700k something like that and it's a great deal for both of you this person take it to their CFO and show really good return on investment so the great thing about this value equation is it also gives you the success metrics that you need to prove during a pilot project so you might go to the customer and say let's try this tool for a month with

00:03:46    with just a portion of your team maybe let's get 10 customer service agents to try it out and see if it actually does reduce queries and let's measure it and as long as it reduces queries by 20% or saves the customer service agents at least 20% of the time we know this value equation holds and if the metrics come back slightly different maybe it only saves 15% or it does really well and saves 25% you can even adjust the pricing based on that but the value equation tells you the the success metrics that you need to prove during a

00:04:14    pilot process so that's the first part of pricing and by far it's the most important if you just stop with that value equation honestly you'll get 80 or 90% of of the pricing spawn on but there are a couple of other elements it's usually useful to consider the first of those is cost what does it cost you to provide this service to the customer it's important you never start with cost some people like to do a cost plus a margin pricing and it just always ends up with you underpricing your software

00:04:44    cost should only ever be a floor so you you do your value equation you take a third of it um that comes out to $700,000 perhaps your costs are mainly open AI fees or something like that and AWS fees and that comes to something like $200,000 so $700 K is your contract value 200k is your cost you're golden if however you've come up with a value equation and and your share of it which only comes in at 150k and your cost a 200k you're in a bad business know you'll have to price at below your cost which is not sustainable and so you're

00:05:18    either going to have to figure out um how to demonstrate more value or change what you're building ultimately or get out of the business entirely really you should be aiming for software margins of like 80 or 90% note on uh credits so people AWS Microsoft open AI giving out tons and tons of credits to startups you should treat those as a cash cost don't assume you'll have unlimited credits forever it'll totally mess up your margins there are occasionally situations where you might want to price at or even below

00:05:50    cost but it's a really really risky maneuver typically used by Founders who want to grab market share in a in a you know in an arms race it's a land grab situation it's very very dangerous you're really betting that the costs are going to come down dramatically in future although having said that with the development of llms um companies like open Ai and anthropic do keep dramatically reducing costs so there's perhaps some argument that you might want to price a little bit lower now because you know your margins are going

00:06:17    to improve with time but honestly it's a really risky maneuver and I would advise startups to to really try to keep to that 80 or 90% uh gross margin so the third element in pricing is competition so you've done your value equation you've calculated about a third of that you've checked that your costs are way way below that so you're sustaining a sort of 8 90% Marin you're in good shape but you have a direct competitor who's just entered the market and uh their software is equivalent to yours and

00:06:46    they've decided to underprice you by half what do you do this is really really tricky a Founder's um first response is to often just engage in a price War so to take the price that your competitors's offered and then just undercut them the problem is they'll do the same undercut you and that you'll undercut them again and it's just a race to the bottom so competing solely on pricing really is not a winning maneuver you don't want to get into a head-to-head bidding war for a commodity product instead what you want to do is

00:07:17    set your product apart based on functionality or value it can't be an apples for apples comparison your product needs to be differentiated if there's extreme competition in an industry for a commodity product that's a product where they're all basically the same all the margin gets driven out so you take the airline industry as an example basically commodity taking a a seat in an airplane um across the country the airline industry on average has 2.7% net profit margin it's a brutal brutal business and airlines are on the

00:07:48    brink of going bus the whole time because they're just struggling to differentiate so now we've talked about the three main elements starting with the value equation considering your cost and competition we're going to talk about other techniques for determining the price or maybe even the pricing structure so another question you want to ask uh your Champion is how and what do they pay for other similar software products for example are they used to paying a monthly flat fee or per sey pricing or usage bands or credits I

00:08:18    would really explore the industry you're selling into and understand what they're used to paying and and the way they're used to structuring pricing and then pick a pricing strategy they're used to people typically are wary of totally uncapped usage based pricing so you might want to put a cap on that and really if you can mirror the way they are used to paying for other software the better you'll do overwhelmingly though when you're choosing pricing it's important to keep it simple over complicating pricing will kill a sales

00:08:47    process in general committed recurring Revenue that's monthly recurring revenue or annual recurring revenue is preferable to usage based pricing and that's because during an economic downturn or a Slowdown your revenue is protected at least until the contract is up for Renewal and then you can have a debate with the customer about whether it's worth renewing whereas if it's pure usage based Revenue there's a real risk that your Revenue just falls off a cliff in a in a bad month and investors are really worryed

00:09:14    about that so if you can uh aim for Mr or even ARR one technique to do this is to start with usage based pricing for new customers um run the the the contract for a month or two and see what usage is and then offer to move them to a minimum monthly commitment uh with volume discounts so you can see they're using on average $15,000 a month offer them a 12,000 a month flat fee which includes all their usage if they commit to a 12-month contract another technique is to ask your Champion what amount

00:09:49    they're able to personally sign off without having to get additional approvals from the CFO or the legal team so maybe have they have signing authority of up to $15,000 that's a good hint that you should keep your Pilot pricing to maybe $149.99 something like that just to keep it moving really really quickly next I want to talk about whether you should publish your prices on your website or have a contact sales for Enterprise pricing there are strong feelings about this on the internet and often software

00:10:19    developers say I just want to see the price I just want to click a button and put my credit card into bio I hate talking to sales why do I have to talk to sales the problem is the value equation is going to be different for each Enterprise customer that's why most Enterprise plans say contact sales if you choose a price randomly and put it on your website for an Enterprise contract you are certainly leaving money on the table you'll overprice the product for a whole chunk of customers who don't get that much value out of it

00:10:46    so you've lost them entirely and for the people who get much more value out of it you're underpricing it for that segment dramatically so typically what companies do is have one or two cheaper plans perhaps an individual plan and a small team or startup plan that contains most of the basic functionality but excludes the core functionality that enterprises really really want so you can go and look at other SAS company pricing pages and see what they gate behind Enterprise plans often it's things like uh sock 2

00:11:15    audit reports or single sign on or audit logs or compliance reports or data being kept in certain geographies things like that uh that really individuals and small companies don't really care about and Enterprises find absolutely vital and can't live without that allows you to um to price differently for your small customers and your Enterprise customers sometimes up to 10 times more for Enterprise customers for these um extra compliance legal data privacy kinds of features the next thing we should talk about is understanding that

00:11:46    your pricing strategy dictates your sales channels but differently at this pricing level is there enough money in each contract to compensate a sales team or account Executives so a good rule of thumb is about a 5:1 ratio between new signed ARR and total compensation for a salesperson including commission so for example if you you pay a salesperson $100,000 a year in annual compensation including their base salary plus uh any sales commission so 100,000 total compensation you might reasonably expect

00:12:23    that salesperson to close $500,000 of new AR every year but $500,000 of new AR can can be split down in so many different ways is that $500,000 contracts in which case each account executive is really they're hunting whales they're trying to close a contract every couple of months something like that and they might might only be working on four five six contracts at a time or is it 20 time $25,000 contracts so $25,000 annual contract about $22,000 a month and your account Executives would need to close

00:12:59    about two of those per month just under two to meet 20 per year to get to that $500,000 contract still doable or are you tasking them with closing $500,000 annual contracts every year so that last example $1,000 annually is about $83 a month your sales rep has to clo close 42 deals every month that's almost two every single working day that's not really a true account executive or outbound sales team at best you might have a call center of inside sales so they're basically picking up the phone when someone wants to buy and

00:13:33    you know typing stuff into a a computer system and answering questions it's not they're not out hunting whales anymore they're really sort of harvesting a you know a field of wheat or something the next subject I want to talk about is whether you should offer free trials or pilots in general offering a really long free trial or a pilot is counterproductive uh the customer not actually bought into using the product and so what you want to do is keep these these Pilots or these proof Concepts really really short maybe a couple of

00:14:02    weeks maybe four weeks with really really clear success criteria from what we talked about earlier with the the value equation a better technique if you're really confident is to push your customers to sign up for an annual contract from the very start but with a 30-day or 60-day money back guarantee and opt out at the start so if it doesn't deliver what they want they can get their money back no questions asked but by default it becomes a recurring contract You Can Count this as recurring Revenue pretty much straight away

00:14:31    another question I get is we just a two or three person startup should we uh you know um put up more people on our website or uh sign more people up to our LinkedIn company account to act like we're a much much bigger company to try and close these customers in general no that's not a good idea what you should do instead is play to your strengths as a startup say to your customers you can have the phone number of the founders and we're on call 24/7 to come and fix your problems you're certainly not going

00:14:59    to going to get that from Salesforce or Oracle or something like that so play into your strengths as a startup okay in conclusion if you really really don't know how to price you've tried the value equation it's it's just not worked you just it's too uncertain somehow honestly just pick a number that's similar to other kinds of software that your customers buy and then what I would do is increase that number by 50% for every time you pitch a new customer so you start at 10,000 and they say yes and the

00:15:28    next customer you going 15 and the next customer maybe you get a 22,000 and when you start to lose more than 25% of potential deals base solely on price you're now probably in the right ballp so you don't need to win every single deal and if every single deal is closing straight away you're almost certainly underpricing and just remember if your company is successful these initial 5 10 customers you sign up at the start are going to be a tiny tiny fraction of the revenue you make over the next 5 years and so it's more

00:15:59    important to start signing deals and getting to the flow of it you can always increase prices as the product improves you add new modules and put them behind a payall or upsell customers so over optimizing for pricing early is a big mistake pick a number try and sell it and and just experiment As you move on it gets easier and easier to close customers and increase prices as the company grows because you presumably are getting better at sales over time you're getting validation logos on your homepage of all of the happy customers

00:16:28    who you're using your product and unless you're doing something really wrong your product should be improving dramatically over time the first two or three sales are normally the absolute hardest you'll ever have to do uh so just get them closed so to recap there are three really really important parts to any pricing first is the value equation write it down get your Champion to challenge it and then price at about a third of the value you're delivering so the customer keeps 2third of the value

00:16:58    you keep one third second consider cost make sure you're not pricing at or below cost unless you've got a really really good plan to dramatically reduce costs in the short to medium term and then thirdly if there's competition in the space you could get into a pricing war and really no one wins from that and so it's better rather than engaging head on with a competitor try to differentiate your product pick a niche focus on certain Integrations or certain industries and show how your product is

00:17:27    dramatically better and really inoma able to competitors and that's it that's had a price I'd love any questions in the comments below thanks for listening [Music]
 


Monday, March 17, 2025

Top programming courses to get you started as a beginner programmer

Last update: 2025.03.23

Learn to Program: The Fundamentals (Coursera)
https://www.coursera.org/course/programming1

Programming for Everybody (Python) (Coursera)
https://www.coursera.org/course/pythonlearn

An Introduction to Interactive Programming in Python (Coursera)
https://www.coursera.org/course/interactivepython

Introduction to Computer Science and Programming Using Python (MIT @ edX)
https://www.edx.org/course/mitx/mitx-6-00-1x-introduction-computer-2841

CS50's Introduction to Programming with Python (Harvard @ edX)
https://www.edx.org/learn/python/harvard-university-cs50-s-introduction-to-programming-with-python

Python Programming MOOC 2025 (University of Helsinki)
https://programming-25.mooc.fi

Programming Foundations with Python (Udacity) - self paced
https://www.udacity.com/course/ud036
Under 'View courseware'

Useful tools

Python Tutor - Online Compiler, AI Tutor, and Visual Debugger for Python, Java, C, C++, and JavaScript

Wednesday, March 12, 2025

How to filter records by the key in Google Datastore Studio

Add to your query WHERE clause that filters by Key property, and put the following for as the value: 

KEY('entity_kind', 'key_value')

 

Wednesday, March 5, 2025

New features for tracking Bluesky connections and filtering bios

Attention Bluesky users! I have updated a small tool that I launched two months ago. In addition to listing and exporting follows and followers, you can now check if connections are mutual or unilateral. Plus, you can filter connections by keywords in their bios. These features are available for any Bluesky account, not just your own. You can access the tool at the same link as before:

https://tiptopbot.com


Tuesday, March 4, 2025

Diversifying Digital Dependence: Exploring European and Open-Source Alternatives in a Changing Geopolitical Landscape

In light of ongoing trade wars and the current geopolitical landscape, it's essential to explore European and open-source alternatives for digital products. While not every product can be replaced, we can certainly expand our options. 

https://european-alternatives.eu/categories


On Microsoft killing Skype

On Microsoft killing Skype, a shout-out to all startup founders: do not sell your businesses to the biggest tech companies for billions of dollars! You can still be happy earning millions, and your baby won't be killed down the road.

True, Skype is mostly forgotten, but it's the only service that offers almost free calls to landlines anywhere in the world. Who uses landlines nowadays? Government agencies, banks, airline companies, etc. Ever been abroad and had an emergency? Yes, good luck mailing them.

Now I have to figure out how to get my unused Skype credit back ...


 

Friday, February 7, 2025

Free music and sound effects for your video or game

YouTube Audio Library

Free background music for your videos.
https://www.youtube.com/c/AudioLibraryEN

SoundBible

Free sound clips.
https://soundbible.com/

GDC Game Audio Bundles

Each year they publish 27.5GB+ of high-quality royalty-free sound effects.
Last year bundle: https://gdc.sonniss.com/
Previous years bundles: https://sonniss.com/gameaudiogdc

Pixabay Music and Sound Effects

Royalty-free
https://pixabay.com/music/
https://pixabay.com/sound-effects/

Punchdeck

Free orchestral and electronic music under Creative Commons license.
[Reddit post] [Archive] [YouTube channel]

Bensound

Royalty Free Music for Videos
https://www.bensound.com/

PDSounds.org

Not sure about the license and quality.
https://pdsounds.org/

Splice

Millions of royalty-free one-shots, loops, FX, MIDI and presets. Offers paid plans and requires registration.
https://splice.com/

Free Music Archive

Royalty free music.
https://freemusicarchive.org/

Archive.org

Audio archive
Live music archive

Bonus

56 Best Websites to Create Awesome Royalty Free Sound Effects (archived article from 2014.)

Wednesday, February 5, 2025

Translation / localization platforms

In alphabetical order:

Crowdin

Homepage | Pricing

They claim to be AI powered. Free tier has unlimited public projects and one private project.


Localazy

Homepage | Pricing

 

Loco

Homepage | Pricing

Free for up to 2,000 translations. 2 private projects.


Localizely

Homepage | Pricing

Free tier has 250 hosted string keys, 1 Project, Unlimited Users, Unlimited Languages. Separate request form for open source projects.

 

Phrase

Homepage | Pricing

No free plan.


Smartling

Homepage | Pricing

They also claim to be AI enabled. It's trendy. Plans don't even mention the prices.


Transifex

Homepage | Pricing

Yep, AI empowered. No free plans but they are free for open source projects. You need to contact them in order to see if your project qualifies.


Weblate

Homepage | Pricing

Copylefted libre software, used by over 2,500 libre software projects and companies in over 165 countries.

You can even self-host it. Public projects get free plan.


This time, I need translations for a free, open-source project, so I guess the most natural decision would be to go with a free, open-source translation platform. Weblate, that is.

Tuesday, January 28, 2025

How to Separate Development and Production Code in a JavaScript Project Using npm

In the past, I utilized Ant build scripts to separate development and production source code. Now, as I'm working on a 100% JavaScript project, I have decided to implement a similar separation using npm.

If you want to deploy minified frontend files (HTML, CSS, and JS) while keeping your development code as it is, you will need to do the following:

1. Instruct express.js to serve files from different directories.

const NODE_ENV = process.env.NODE_ENV || "development";
const PORT = process.env.PORT || 3000;

const PATH = path.dirname(new URL(import.meta.url).pathname);
const DIRNAME = NODE_ENV === "development" ? "public_dev" : "public";
app.use(express.static(path.join(PATH, DIRNAME)));

This way, your local server will use source files from the public_dev directory, while the production server will use source files from the directory named public.

2. Once you do that, move to your parent directory and run the following commands:

npm init -y
npm install --save-dev html-minifier clean-css-cli terser

3. Add the following to your package.json file:

  "scripts": {
    "build:backend": "npm run purge:backend && npm run minify:backend",
    "purge:backend": "rsync -r --delete --exclude='*' backend/public_dev/ backend/public",
    "minify:backend": "npm run copy:images && npm run minify:css && npm run minify:html",
    "copy:images": "rsync -a --update backend/public_dev/img/* backend/public/img",
    "minify:css": "rsync -a --update backend/public_dev/css/*.css backend/public/css --out-format='%n' | xargs -I {} cleancss backend/public/css/{} -o backend/public/css/{}",
    "minify:html": "rsync -a --update backend/public_dev/*.html backend/public --out-format='%n' | xargs -I {} html-minifier --collapse-whitespace --remove-comments --remove-optional-tags --remove-redundant-attributes --remove-script-type-attributes --remove-style-link-type-attributes --use-short-doctype --minify-css true --minify-js true backend/public/{} -o backend/public/{}"
  },

Now, running npm run build:backend will delete dangling destination files, copy image files, and copy and minimize CSS and HTML files.

 npm install --save-dev html-minifier clean-css-cli tersernpm install --save-dev html-minifier clean-css-cli terser

Thursday, January 23, 2025

Retrieval Augmented Generation (RAG) and Role-Based Access Control (RBAC): A Quick Overview

Last update: 2024.01.25

These are personal research notes compiled after a brief exploration of retrieval augmented generation and access control implementations.

Extending LLM knowledge with new data sources is also known as Retrieval Augmented Generation (RAG). Here is the Wikipedia definition of RAG:

Retrieval Augmented Generation is a technique that grants generative artificial intelligence models information retrieval capabilities. It modifies interactions with a large language model so that the model responds to user queries with reference to a specified set of documents, using this information to augment information drawn from its own vast, static training data. 
If you plan to implement an LLM with RAG in your company, you will most likely need some form of access control as well. For example, it would not be advisable for an intern to gain access, through prompting, to information that is meant to be restricted to C-level executives.

The following article describes how to Implement Role-Based Access Control in RAG. The example uses Ollama (open-source tool for running LLM's locally).

Here is another article that describes Implementing simple role-based access control in LLM applications, though it's not clear which LLM or tools are used.

Related solutions

LM Studio

https://lmstudio.ai/

Pros:

  • Easy installation and setup
  • Runs various LLMs, entirely offline
  • Chat with local documents
  • Chat UI or an OpenAI API compatible local server
  • Free for personal use

Cons:

  • Not free for business use
  • Not open source
  • Doesn't support access control

open-webui

https://github.com/open-webui/open-webui

Pros:

  • Free and open source
  • Chat with several models simultaneously
  • Image generation
  • Web browsing capability
  • Huge community

Cons:

Other

Another interesting open-source front-end worth following is LibreChat.

Another commercial solution I haven't checked yet is kapa.ai. They say about themselves the following:

Kapa.ai turns your knowledge base into a reliable and production-ready LLM-powered AI assistant that answers technical product questions instantly and helps improve your documentation.

Vector databases that support RAG with access control include Pinecone [docs], which is commercial, and Supabase [docs], an open-source Firebase alternative.

Useful communities

https://www.reddit.com/r/LocalLLaMA/

Wednesday, January 8, 2025

Comparing payment provider fees and features: a breakdown of few popular options

Last update: 2024.01.19

As I prepare to launch my new product, I’ve been evaluating several payment providers (LemonSqueezy, Paddle and PayPro Global) to find the best fit for my needs. To simplify the process, I created this document to consolidate all the relevant details about fees, affiliate commissions, payout methods, and other critical features in one place. By comparing these aspects across platforms, I aim to make an informed decision—and help others do the same.

LemonSqueezy

Fees

LemonSqueezy fee details.

Platform Fees

Their base fee is 5% + $0.50. Additionally to that, they charge:

+0.5% for subscription payments
+1.5% for international (outside of the US) transactions
+1.5% for PayPal transactions

So for example, the total fee for international subscription via PayPal would be 8.5% + $0.50.

Their pricing for microtransactions (under $10) is not disclosed on their website. However, if you ask, they will inform you that it is 5% + $0.30—at least, that's what they told me.

Affiliates and Affiliate Fees

They have an affiliate fee of 3% for each sale done through affiliate referral.
They also deduct 2% from affiliate commission. 

For subscriptions, affiliates earn a commission on the initial sale, as well as on all recurring charges, as long as the customer remains subscribed. 

LemonSqueezy affiliate platform.

Payouts and Payout Fees

For payouts via Stripe:

  • Free for bank accounts in the US
  • 1% per payout for bank accounts outside the US

For Payouts via PayPal:

  • A flat fee of $0.50 per payout for accounts in the US
  • 3% capped at $30 per payout for accounts outside the US

Payout schedule is twice a month and minimum payout threshold is $50.

Paddle

  • They advertise invoicing as a separate service. Customer invoicing is not done automatically.
  • They say that they are working with two affiliate platforms, FirstPromoter and Rewardful, but that they don’t have direct affiliate programs.
  • Contact form doesn't allow duck.com email addresses.

Fees

Platform Fees

Their base fee is 5% + $0.50. There are no additional fees. For subscriptions under $10, they charge a flat 10% fee.

Payouts and Payout Fees

No any additional payout fees, supported payout methods are: PayPal, Payoneer, Bank/Wire transfer. Payout schedule is once a month and minimum payout threshold is $100.

PayPro Global

They have an affiliate system, it can be set up both for the first order only, or for recurring subscriptions. They support tier commissions too.

Fees

If a chargeback occurs, there is a chargeback fee of $15, regardless of the transaction amount.

Platform Fees

Their fee is 4.9% + $1. There is a separate fee for transactions under $10, and it is $0.90. There are no additional fees.

Payouts and Payout Fees

Payouts are once a month. The minimum payout threshold is $400 USD. Payout fee depends on the method:

  • Payoneer pre-paid card – $2 USD
  • Wire Transfer – $21 USD
  • ACH (North America) – $3 USD
  • PayPal For US & Canada – Free
  • PayPal Internationally – 2% (max $20 USD fee)

What to ask your potential payment provider

In case you want to prospect another payment provider, here is a list of additional questions that are mandatory to have answers to:

  • What are the payout fees?
  • What payout methods are supported?
  • What is the minimum payout threshold?
  • What is the payout schedule?
  • Is there any special pricing for microtransactions, e.g., products under $10?
  • Are there any affiliate fees?
  • How is the affiliate commission for subscriptions set up: only for the first charge or for all recurring charges?




Sunday, January 5, 2025

2024. u retrovizoru: Knjiški pregled

U 2024. godini pročitao sam 17 knjiga. Prema statistikama GoodReads-a, kojeg koristim od 2016. godine, čini se da mi je to gornji godišnji limit. Ali dobro je da nađem vremena i za to. Od tih 17 knjiga, izdvojio bih i preporučio sljedeće četiri:

Štorije od žalosti, Drago Orlić

Preporuka iz jedne epizode Explore. Zbirka životnih pričica temeljenih na stvarnim događajima i ljudima. Mjesto radnje je Istra, a period obuhvaća od kraja 19. do kraja 20. stoljeća. Svaka štorija je upečatljiva i osobna, a prikazuje i širi društveni kontekst tog podneblja u tom vremenu. Mene su štorije podsjetile na uratke braće Taviani. Da su braća živa, miritalo bi da ih i ekraniziraju. I to nitko drugi nego oni.

Što nam serviraju: zašto je gotovo sve što ste čuli o hrani pogrešno, Tim Spector

Originalni naslov knjige je Spoon-Fed: Why Almost Everything We’ve Been Told About Food is Wrong.

Zanimljivo je da je ova knjiga preporuka jednog hrvatskog 'političara', katolibana i antivaksera. Ne, ne pratim njegovu inače dijareju na društvenim mrežama, nego jednog od njegovih kritičara, pa je posredno tim putem ta preporuka dospjela i do mene. Naslov knjige je poprilično točan, barem u mom osobnom slučaju, jer knjiga razotkriva niz poprilično uvriježenih i lažnih mitova o prehrani. Napisao ju je profesor genetičke epidemiologije i stručnjak za mikrobiom crijeva. Obavezno je pročitajte ako vodite računa o vlastitom zdravlju.

Životinjska farma, George Orwell

Brutalna kritika brutalne politike Sovjetskog Saveza. "Sve životinje jednake, ali neke životinje su jednakije od drugih", vrijedi na žalost kod nas i danas. Jer naši su vodeći političari, iako su neki od njih kasnije promijenili boje, ipak bili mladi i perspektivni komunistički lideri, pa njihova percepcija vlastite uloge, uloge medija i gospodarstva nije puno drugačija od percepcije koju imaju svinje iz Orwellove farme. Zna se na koga mislim. Oink, oink.

Predvidljivo iracionalni: nevidljive sile koje upravljaju našim odlukama, Dan Ariely

Originalni naslov knjige je Predictably Irrational: The Hidden Forces That Shape Our Decisions.

Na naše odluke utječu očekivanja, emocije, društvene norme i drugi nevidljivi faktori. Sustavno činimo iste pogreške – precjenjujemo ono što imamo, preplaćujemo ili podcjenjujemo ono što nemamo, odgađamo bitne odluke, itd. Svi ti obrasci su predvidljivi, a ne nasumični. Ova knjiga govori o tome kako ih prepoznati i donositi bolje odluke u životu.

Sve spomenute knjige imate u gradskoj knjižnici, a godišnja članarina je manja od €15. Vjerojatno jedna od najboljih investicija za ovu godinu. Jedna od najboljih, a možda i najbolja investicija za ovu godinu. Navali narode.

Saturday, January 4, 2025

Software development on a touch phone (2)

Continuing on my previous post Software development on a touch phone (1), I’m excited to share that my Bluetooth keyboard has finally arrived! I’m still getting used to its dimensions and unfamiliar layout. Additionally, I’ve set up Neovim and even added a GitHub Copilot plugin. The results are promising—check out the images and video below!

Rate my setup:
$0.96 Bluetooth keyboard (AliExpress welcome deal)
$1.20 Phone stand
$40 Second hand Nokia 6.1 (with charger!)
$0 LineageOS + Termux + Neovim + GitHub Copilot




Thursday, January 2, 2025

Converting webm video to mp4 and mp4 to mp3 on Ubuntu

Converting webm to mp4

Ubuntu's built-in screen recorder saves videos in WebM format. Some social media platforms do not support it, so you might find yourself needing to convert them to MP4 format. Make sure you have FFmpeg installed first:

sudo apt install ffmpeg

After that, it's just a one-liner (command line parameters are explained below):

ffmpeg -i video_file.webm -vf "pad=ceil(iw/2)*2:ceil(ih/2)*2" -r 30 video_file.mp4

-vf "pad=ceil(iw/2)*2:ceil(ih/2)*2" is a workaround for videos whose dimensions are not even numbers.

-r 30 sets the rate to 30 frames per second. You can set your own value here. FFmpeg actually keeps the frame rate of the original file, though it might get confused in case it is a variable rate.

Converting mp4 to mp3

ffmpeg -i input.mp4 -map a output.mp3