Hosted Inference via Featherless.ai — Design Document
Status: Shipped, in a broader shape than this concept (verified 2026-09-29). Featherless is the platform's hosted rail for every conversation, not only paid experiences: the built-in presets labelled Powered by Featherless (provider featherlessplatform) run on the platform key with no API key needed, and replaced the retired free OpenRouter rail (removed in the 2026-05-19 sweep). Per-turn Echo billing for them is built on the compute allocate/settle rail, switched on by an admin setting; the concurrency guard shipped 2026-06-05 as an in-process queue; and since 2026-09-11 (d109b817) Discord turns on a platform preset are billed to their payer the same way. Still unbuilt from this doc: its Paid Experiences integration (paid packages). The operational spec is docs-internal/architecture/chat-engine/PLATFORM_MODELS.md; the text below is the original concept and describes a v1 scope ("free conversations remain BYOK-only") that the shipped design superseded.
Overview
Today the platform is BYOK-first: users bring their own API key from Anthropic, OpenAI, Google, OpenRouter, or Featherless. That works for power users but fails most of our audience — "API key" is jargon, and several of the major providers are inaccessible or hostile to the kinds of fiction our users write.
Hosted inference is the platform serving LLM calls using its own credentials, paid for in Echoes. This document covers the first hosted provider: Featherless.ai.
Featherless is chosen specifically because:
- Its content policy is narrow and predictable — it hosts open-weight models from HuggingFace and lets the choice of model do the censorship rather than enforcing a content policy on top.
- The catalog is enormous (~37,000 models, ~15,000 conversational) — far beyond what any single first-party provider exposes. Niche fine-tunes like Mistral Nemo roleplay variants, Qwen Coder, and uncensored Llama derivatives are all first-class.
- Pricing is subscription-based — flat monthly fee for unlimited inference within concurrency slots, no per-token billing. This makes platform unit economics predictable and decoupled from message length.
- It returns standard OpenAI-shaped
usageobjects per response, so we can still record token counts for analytics and abuse detection even though we aren't billed per-token. - They've publicly stated they don't retain prompts long-term — same privacy posture our users already expect.
This document covers provider integration, the subscription cost model (this is the biggest divergence from typical per-token providers), catalog sync, abuse mitigation, and how hosted inference plugs into Paid Experiences.
Scope
In scope
- Featherless as a hosted provider backed by a platform-owned subscription
- Per-request token counting for analytics + abuse detection (not for billing)
- Daily catalog sync — model availability, concurrency cost, and feature flags
- Pipeline integration for paid package conversations
- Concurrency-slot guard rails to stay within the platform's plan
- Abuse/audit logging on our side (Featherless does not retain prompt logs)
- Fallback when a model is deprecated upstream (HuggingFace removes it) or temporarily unavailable
Out of scope for v1
- Hosted inference on free (non-paid) conversations — those remain BYOK-only
- Additional hosted providers (Venice, Infermatic, OpenRouter's premium pool). The provider abstraction is designed to accept them; onboarding is tracked separately.
- Per-user concurrency reservations beyond what the global slot budget enforces
Why Featherless, Not Anthropic/OpenAI
| Concern | Anthropic / OpenAI | Featherless.ai |
|---|---|---|
| Content policy surface | Wide and fuzzy — roleplay can trip filters unpredictably | None at the provider level — model choice is the policy |
| Account risk | High — one fuzzy enforcement incident can kill production access | Low — subscription is straightforward, no surprise content bans |
| Cost predictability | Per-token, can spike on long messages | Flat monthly subscription — message length doesn't move the bill |
| Catalog | ~10–20 first-party models | ~15,000 conversational models including community fine-tunes |
| Prompt retention | Often retained, sometimes used for training | Not retained — confirmed by Featherless |
| API shape | Native OpenAI / Anthropic / Google SDKs | OpenAI-compatible at /v1/chat/completions |
Featherless is not a replacement for BYOK. Users who want Claude Sonnet or GPT-4o specifically should keep bringing their own key — that path stays first-class. Featherless fills the gap for users who cannot or will not manage API credentials, and it unlocks a model catalog no first-party provider matches.
What Featherless does not give us
- "No content policy" does not mean "no ToS at all". CSAM, targeted real-person sexual content, and other universal hard lines are still prohibited. Our content moderation must cover these categories with the same seriousness we'd apply for any provider.
- No prompt retention means we cannot ask Featherless to retrieve a prompt after the fact for abuse review. We must keep enough on our side to respond to a complaint.
- Subscription billing means we eat the cost of unused capacity on slow days and are bottlenecked by concurrency on busy ones. Margins depend on right-sizing the plan against actual usage, not on per-call accounting.
Provider Integration
Adapter Location
Featherless is already integrated as a BYOK provider via FeatherlessLlmClient (extends StrictOpenAiLlmClient — Featherless rejects non-standard sampler params). Hosted-inference reuses the same client; the only addition is a routing rule that points it at the platform-owned API key when the conversation is a paid experience.
Core/LLM/
├── Providers/
│ ├── AnthropicLlmClient.cs (existing, BYOK)
│ ├── OpenAiLlmClient.cs (existing, BYOK)
│ ├── GeminiLlmClient.cs (existing, BYOK)
│ ├── OpenRouterLlmClient.cs (existing, BYOK)
│ └── FeatherlessLlmClient.cs (existing — used for both BYOK and hosted)
└── ProviderResolver.cs (extended: route hosted requests to platform key)
API Surface
Featherless exposes an OpenAI-compatible chat completions endpoint plus a model catalog. We already consume both:
| Endpoint | Purpose |
|---|---|
POST /v1/chat/completions |
Standard chat completions, streaming and non-streaming. OpenAI-shaped. |
GET /v1/models |
Returns model catalog with q, page/per_page, sort, family, model_class, gated, conversational, context_length_min/max, parameter_size_min/max, etc. Used live by the model picker; polled daily by the catalog sync job for hosted inference. |
There is no /billing/balance equivalent because Featherless billing is a flat subscription invoiced separately. Plan/concurrency status is monitored via the dashboard (manual, for v1).
Authentication
The platform holds a single Featherless API key (FEATHERLESS_PLATFORM_API_KEY) in its secrets store. Separate from any user-configured Featherless keys. This key is never exposed to the client and is only used when a request is routed to hosted inference. BYOK users keep using their own keys against the same FeatherlessLlmClient.
Streaming
Featherless supports SSE streaming. The adapter already plugs into our shared SSE streaming helper — no additional client-side work needed for the hosted path.
Cost Model
This is the section that diverges most sharply from a per-token hosted provider (Anthropic, OpenAI, Venice). Featherless billing is flat-rate subscription, so we need a different mental model for what "cost per message" means and how the Echo price floor is set.
What Featherless Bills
The platform pays a monthly subscription. Featherless plans cap:
- Concurrent requests — number of simultaneous in-flight chat completions (small models = 1 slot, large MoE models = 2-3 slots via the model's
concurrency_costfield). - Plan-tier model access — some larger or more expensive models are gated behind the higher plans.
There is no per-token charge. Sending one 200-token message and one 20,000-token message costs the platform the same — both consume one (or N) concurrency slots for however long the model takes to respond.
What This Means for Echo Pricing
Because the underlying cost is fixed-monthly-fee + concurrency-bound, Echo pricing for paid experiences cannot be derived from per-token rates. Instead:
- Bucket models by class. Featherless's
model_classfield groups models by family + size (e.g.,qwen3-32b,mistral-v01-7b,llama2-solar-10b7). Each class gets a tier —small/medium/large— based on itsconcurrency_cost,parameter_size, and observed average response time. - Price each tier in Echoes. A
smallmessage costs N Echoes,mediumcosts M,largecosts L. The numbers are picked so that expected platform monthly cost / expected message volume sits comfortably below the Echo revenue per message. - Tiers feed the Paid Experiences price floor. The minimum Echo price a creator can set on a Featherless-backed package is the tier's floor; the suggested range adds the platform margin.
- Tiers are reviewed quarterly rather than synced daily — they don't change unless our subscription changes or the catalog shifts substantially.
This is fundamentally different from the per-token sync job a per-billed provider would need.
platform_model_costs Schema Adjustments
The existing platform_model_costs table from Paid Experiences was designed assuming per-token rates. For Featherless models, the per-token columns are NULL and a new pricing_model column distinguishes the two:
ALTER TABLE platform_model_costs
ADD COLUMN IF NOT EXISTS pricing_model VARCHAR(20) NOT NULL DEFAULT 'per_token',
ADD COLUMN IF NOT EXISTS subscription_tier VARCHAR(20), -- 'small' | 'medium' | 'large' for Featherless
ADD COLUMN IF NOT EXISTS concurrency_cost INTEGER; -- mirrored from Featherless catalog
COMMENT ON COLUMN platform_model_costs.pricing_model IS 'How the upstream provider bills: "per_token" (Anthropic, OpenAI, OpenRouter, Venice) or "subscription" (Featherless).';
COMMENT ON COLUMN platform_model_costs.subscription_tier IS 'For subscription providers: which platform-defined cost tier this model belongs to. Drives the Echo price floor.';
For pricing_model = 'subscription', the per-token columns are NULL and the floor lookup uses subscription_tier instead.
Per-Message Reconciliation
We still record the standard usage object per response (Featherless returns prompt_tokens, completion_tokens, total_tokens in OpenAI shape) and write them into web_message_stats for analytics and abuse detection. They are not used for billing — the user is charged the reserved Echo amount regardless of token count, because that's how Featherless bills us.
The reservation-vs-actual margin metric becomes a margin-vs-tier metric: did the user's reserved Echo amount exceed the tier's floor by enough to cover platform overhead at expected volume?
Catalog Sync
Even though Featherless doesn't change pricing, the catalog itself changes — models get added, gated, deprecated, or removed entirely when their HuggingFace upstream goes away.
Sync Job
Frequency: Once per day (02:00 UTC)
Source: GET https://api.featherless.ai/v1/models?conversational=true&per_page=1000
Target: platform_model_costs table (Featherless rows)
The job:
- Pages through
GET /v1/models?conversational=true(subset to chat-capable models — embedding/completion-only models aren't usable in our pipeline). - For each model: upsert into
platform_model_costswithpricing_model='subscription',concurrency_costfrom the response, andsubscription_tierlooked up from a static map keyed onmodel_class(e.g.,qwen3-32b → large,mistral-v01-7b → small). - Models no longer present in Featherless's response are marked
is_available = FALSEbut not deleted — existing package references keep working until fallback kicks in (see Resilience). - New models or new
model_classvalues get logged for admin review — the static class→tier map is curated, not auto-extended, so new model classes need a deliberate decision about which tier they belong to. - Models that flip
is_gated = trueare downgraded tois_available = FALSEfor hosted use unless the platform's plan covers them — gated models often require additional permissions per-account.
Alerting
The sync job emits admin alerts when:
- A model previously available becomes unavailable (so creators with paid packages on it can be notified).
- A new
model_classappears (for tier-mapping decision). - The catalog API call fails two days in a row.
- The total conversational catalog size shifts by more than 10% in a single sync (signals an upstream change worth investigating).
Pipeline Integration
Featherless plugs into the existing paid experience pipeline. The new pieces are (a) a routing rule that swaps in the platform key when the conversation is a paid experience, and (b) the cost reconciliation step (which is mostly recording-for-analytics rather than billing).
Pre-LLM
1. Is this a paid package conversation? (existing)
2. Is the user in free trial? (existing)
3. Does the user have enough Echoes to reserve? (existing)
4. Reserve echo_price_per_message (existing)
5. Resolve provider: paid_model_identifier → FeatherlessLlmClient
with platform API key (instead of user's BYOK key) (new)
6. Concurrency budget check — does the platform have a free slot? (new)
LLM
7. FeatherlessLlmClient.GetCompletionStreamAsync(request) (existing client, hosted key)
- Streams response back via existing SSE helper
- Captures usage object from final chunk
Post-LLM
8. Commit reservation to creator wallet (existing)
9. Record web_message_stats with:
echo_cost = reserved amount (what user paid)
echo_creator_earned = creator share
hosted_provider = 'featherless' (new)
token_count_in/out = from Featherless usage (new)
The reservation reconciliation against actual platform cost (the Venice doc had a USD comparison here) becomes a tier-margin check instead — does the reserved Echo amount stay above the tier floor?
Provider Resolution Rules
When the pipeline needs to pick a provider:
- If the conversation is BYOK → use user's configured provider with their key (existing).
- If the conversation is a paid experience → look up
package.paid_model_identifier. - If the model identifier's prefix is
featherless/(or the model class maps to a Featherless-only model) → route toFeatherlessLlmClientwithFEATHERLESS_PLATFORM_API_KEY. - If the model is unavailable (flagged in
platform_model_costsor rejected by Featherless) → see Resilience.
web_message_stats Schema Additions
Same as the Venice design — additive and non-breaking, NULL for BYOK messages:
ALTER TABLE web_message_stats
ADD COLUMN IF NOT EXISTS token_count_in INTEGER,
ADD COLUMN IF NOT EXISTS token_count_out INTEGER,
ADD COLUMN IF NOT EXISTS token_count_cached INTEGER,
ADD COLUMN IF NOT EXISTS hosted_provider VARCHAR(30);
COMMENT ON COLUMN web_message_stats.hosted_provider IS 'Hosted provider that served this message (e.g., "featherless"). NULL for BYOK.';
There is intentionally no platform_actual_cost_usd column for Featherless rows — there is no per-message USD cost. The platform-cost view for Featherless is computed at the subscription level (monthly bill / message count = blended per-message cost), not per-row.
Resilience & Fallback
Featherless is an external dependency and will occasionally fail. The platform must degrade gracefully without losing user trust.
Health Check
Featherless has no /billing/balance equivalent (no balance to check on a subscription). The health check polls GET /v1/models?per_page=1 every 5 minutes and flips an internal flag if two consecutive calls fail. Failed health status surfaces on the admin status dashboard.
Concurrency Guard
Because Featherless caps concurrent slots per plan, a traffic spike can push us past the plan's concurrency limit and start getting 429s. The platform tracks in-flight Featherless requests in a process-local counter (single replica) or a Redis counter (multi-replica) and:
- Keeps a soft ceiling at 80% of the plan's slot count. Hitting the soft ceiling shows the user a "high demand — your message is queued" indicator.
- Hits the hard ceiling at 100%. Additional requests get queued for up to 30 seconds before failing with a friendly retry message; the Echo reservation is released.
This bounds burstiness without needing per-user rate limits. Per-user limits get added if abuse data shows a single user is monopolizing slots.
Failure Modes
| Failure | Behavior |
|---|---|
| Featherless 5xx on a chat request | Retry once with exponential backoff. If still failing, release the Echo reservation, return a friendly error to the user, log the incident. No charge to the user. |
| Featherless model deprecated (model_id 404 or removed from catalog) | Package auto-falls back to the closest available model in the same subscription_tier (see Paid Experiences — Model becomes unavailable). Creator is notified. |
| Featherless platform-wide outage | All paid experiences using Featherless show a banner: "Hosted inference is temporarily unavailable. You can switch to Bring Your Own Key to continue this conversation." Free BYOK path remains functional. |
| Plan concurrency exceeded | Soft-queue up to 30s, then fail-with-retry. Persistent saturation triggers an admin alert and a recommendation to upgrade plan. |
| Rate limited (429) | Treated as transient; queue and retry with backoff. Repeated 429s over 10 minutes escalate to admin alert. |
| Featherless subscription lapsed | All /v1/chat/completions calls 401. Platform flips Featherless-hosted off entirely until renewed; creators with affected packages get notified. (We monitor renewal dates separately.) |
Volume Guard
To prevent runaway message volume (e.g., a bug spamming Featherless), the platform enforces a hard daily message ceiling on platform-paid Featherless requests. The ceiling is configurable, defaults conservatively (e.g., 10,000 messages/day for the initial rollout — tune based on plan tier). Hitting the ceiling triggers:
- Immediate admin alert.
- New paid conversations on Featherless-backed packages are blocked.
- In-flight conversations finish their current message but pause afterward with the "temporarily unavailable" banner.
- Ceiling resets at 00:00 UTC next day, or an admin can raise the ceiling manually.
This is the per-message analog of the Venice doc's USD ceiling — Featherless doesn't bill us per message, but a runaway loop still exhausts our concurrency budget and harms availability for legitimate users.
Abuse & Audit
Featherless does not retain prompt logs long-term. That is a feature for user privacy, but it means we must keep the minimum audit trail needed to respond to abuse reports and regulatory requests.
What We Log (Hosted-Only)
For every message served via a hosted provider, we retain:
| Field | Purpose |
|---|---|
message_id |
Join key to web_messages |
user_id, conversation_id, package_id |
Who, where, what product |
hosted_provider, model_identifier |
Which provider and model |
token_count_in/out |
Abuse detection (unusual spikes), analytics |
moderation_flags |
Results from our pre-send content moderation pass |
prompt_hash |
SHA-256 of the assembled prompt — used to detect repeat offenders without storing plaintext |
response_hash |
SHA-256 of the model response — same purpose |
Plaintext prompts and responses are not retained for hosted inference beyond the usual conversation history that the user owns. The hashes let us recognize patterns (same prompt sent thousands of times, for example) without building a content archive.
Moderation Pipeline
Content moderation runs before the Featherless call, not after. The platform already does minor detection on personas, lorebooks, and greetings (see project state). Hosted inference tightens this to a pre-send gate on every assembled prompt, because:
- Featherless models will happily serve requests that trip our universal hard lines — the provider deliberately doesn't enforce content policy at the API layer.
- We are the API customer of record. Any policy violation that involves Featherless's hard lines (CSAM, etc.) traces back to our subscription.
- Featherless does not log, so we cannot rely on provider-side review after the fact.
The moderation pass runs on the fully-assembled prompt (system + lorebook injections + persona + recent history + new user turn). Flags that hit a hard-line category block the request, release the Echo reservation, and record the incident. Flags below the hard-line threshold are logged for trend analysis but do not block.
Incident Response
When we receive an abuse report naming a specific user or conversation:
- Pull
web_message_statsrows for the flagged conversation. - Cross-reference
moderation_flagsandprompt_hash/response_hashfor patterns. - Use the user-owned conversation history (plaintext, already retained for the user's own access) to review content.
- Take action against the user per ToS. Featherless is not contacted unless the incident involves a hard-line violation that materially affects our subscription standing.
Rollout Plan
- Routing rule —
ProviderResolverswaps the user's API key forFEATHERLESS_PLATFORM_API_KEYwhen the conversation is a paid experience and the model identifier is a Featherless model. The existingFeatherlessLlmClientdoes the rest. platform_model_costsschema — Addpricing_model,subscription_tier,concurrency_cost. Backfill existing rows topricing_model = 'per_token'.- Tier map + seed — Define the
model_class → subscription_tierstatic map. Seedplatform_model_costswith the current top-100 conversational models grouped into tiers. - Catalog sync job — Daily scheduled task. Walks
GET /v1/models?conversational=true, upserts availability + concurrency_cost, alerts on new model classes. - Pipeline wiring — Provider resolver, concurrency guard, post-LLM analytics recording.
- Moderation gate — Pre-send hard-line check on assembled prompt for hosted requests.
- Audit logging —
web_message_statsschema additions, prompt/response hashing. - Health monitor + volume guard — Background catalog poll for liveness, daily message ceiling, admin alerts.
- Admin UI — Featherless dashboard showing current plan tier, today's message volume, concurrency utilization, recent catalog changes, moderation flag trends.
- Limited beta — Enable on 1-2 staff-authored packages with a low daily ceiling. Verify concurrency behavior under load and moderation coverage.
- General availability — Open hosted inference as an option in the package workbench for verified creators, scoped to a curated subset of model classes.
Open Questions
- Plan tier sizing. Which Featherless plan ($10 / $25 / $75) do we start on, and at what message volume / concurrency does it stop being economical to scale plan vs. add a second hosted provider? Need real beta numbers to decide.
- Curated model catalog vs. open catalog. Featherless has 15,000 conversational models. Do we expose all of them in the package workbench, or curate a short list per
subscription_tier? Curated is easier to support and to moderate. Starting curated (one "showcase" model per tier) is probably right; expand based on creator demand. - Per-user concurrency reservations. A single user firing rapid messages against a
large-tier model (concurrency_cost=2) can monopolize slots. Once we have real traffic, decide whether to add per-user concurrent-request limits beyond the global slot budget. - Tier→Echo pricing math. The actual Echo price per tier comes out of "monthly subscription cost ÷ expected paid messages per month × margin multiplier". The numerator is fixed; the denominator and multiplier need real data. Probably ship with conservative pricing and tune at the first quarterly review.
- Multi-provider hosted inference. Featherless is hosted provider #1, not the only one. When we add a per-token provider (e.g., Venice for first-party Llama, OpenRouter's premium pool), the
pricing_modelcolumn already distinguishes the two billing styles — but the admin UI and reconciliation paths will diverge. Plan for that divergence rather than papering over it. - Disclosure to users. The package listing should probably indicate that a paid experience is served via Featherless (with a short explainer of what that means for content and privacy), not hide the implementation detail. Transparency builds trust.
- ToS acceptance for hosted users. Using hosted inference should require acknowledging a hosted-inference-specific notice covering moderation, audit logging, and the fact that content is served via a third-party provider. Separate from the platform ToS.
Related Documents
- Paid Experiences — The Echoes currency, pricing floor, revenue share, and pipeline billing stages this document builds on.
- Daily Tasks & Echoes — The full Echo economy including the ledger-only wallet architecture.
- Packages — The entity that carries the
paid_model_identifierand pricing fields. - Creator Analytics — Consumes the per-message data recorded here for revenue dashboards.
- Tiers & Limits — Subscription context; hosted inference is orthogonal to tier.