cerebras_coderREADME.md2 matches
891. Sign up for [Cerebras](https://cloud.cerebras.ai/)
102. Get a Cerebras API Key
113. Save it in your project env variable called `CEREBRAS_API_KEY`
cerebras_coderindex.ts1 match
211} catch (error) {
212Toastify({
213text: "We may have hit our Cerebras Usage limits. Try again later or fork this and use your own API key.",
214position: "center",
215duration: 3000,
cerebras_coderindex.html3 matches
5<meta name="viewport" content="width=device-width, initial-scale=1.0">
6<title>CerebrasCoder</title>
7<link rel="preconnect" href="https://fonts.googleapis.com" />
8<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
9<link
10href="https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap"
11rel="stylesheet"
12/>
21<meta property="og:description" content="Turn your ideas into fully functional apps in less than a second – powered by Llama3.3-70b on Cerebras's super-fast wafer chips. Code is 100% open-source, hosted on Val Town."">
22<meta property="og:type" content="website">
23<meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">
24
25
16};
17} else {
18const client = new Cerebras({ apiKey: Deno.env.get("CEREBRAS_API_KEY") });
19const completion = await client.chat.completions.create({
20messages: [
281}
282283// Optional: Add a small delay to be respectful to the API
284if (fetchFullHistory) {
285await new Promise(resolve => setTimeout(resolve, 100));
fetch-socialsfetchMastodon.tsx2 matches
2324// Step 1: Look up the account ID
25const accountLookupUrl = `https://${MASTODON_INSTANCE}/api/v1/accounts/lookup?acct=${MASTODON_USERNAME}`;
26console.log("Looking up account ID...");
2737// Step 2: Fetch recent posts (statuses)
38const statusesUrl =
39`https://${MASTODON_INSTANCE}/api/v1/accounts/${accountId}/statuses?limit=40&exclude_replies=true&exclude_reblogs=true`;
40console.log("Fetching recent posts...");
41
flyFlyApiClient.ts13 matches
1// Fly.io API client and HTTP endpoints
2import { Hono } from "https://esm.sh/hono@3.11.7";
39});
1011// Types for Fly.io API responses
12interface FlyApp {
13id: string;
47}
4849// Base API client functions that can be imported by other files
50export class FlyApiClient {
51private token: string;
52private baseUrl = 'https://api.machines.dev/v1';
5354constructor() {
6970if (!response.ok) {
71throw new Error(`Fly.io API error: ${response.status} ${response.statusText}`);
72}
73104app.get('/apps', async (c) => {
105try {
106const client = new FlyApiClient();
107const orgSlug = c.req.query('org_slug') || 'personal';
108const apps = await client.getApps(orgSlug);
115app.get('/apps/:appName', async (c) => {
116try {
117const client = new FlyApiClient();
118const appName = c.req.param('appName');
119const app = await client.getApp(appName);
126app.get('/apps/:appName/machines', async (c) => {
127try {
128const client = new FlyApiClient();
129const appName = c.req.param('appName');
130const machines = await client.getMachines(appName);
137app.get('/apps/:appName/machines/:machineId', async (c) => {
138try {
139const client = new FlyApiClient();
140const appName = c.req.param('appName');
141const machineId = c.req.param('machineId');
149app.get('/apps/:appName/machines/:machineId/events', async (c) => {
150try {
151const client = new FlyApiClient();
152const appName = c.req.param('appName');
153const machineId = c.req.param('machineId');
159});
160161// Root endpoint with API documentation
162app.get('/', (c) => {
163return c.json({
164message: 'Fly.io API Proxy',
165endpoints: {
166'GET /apps': 'List all apps (optional ?org_slug=personal)',
1import { FlyApiClient } from "./FlyApiClient.ts";
23export default async function(req: Request): Promise<Response> {
4try {
5const client = new FlyApiClient();
6const response = await client.getApps();
7const apps = response.apps || [];
ContextualREADME.md2 matches
60- `BASE_URL`: Base URL for email verification links (optional)
6162## API Endpoints
6364- `GET /` - API documentation and status
65- `GET /health` - Health check endpoint
66- `POST /register` - User registration (no auth required)
1920export interface AppConfig {
21anthropicApiKey: string;
22mcpServers: MCPServer[];
23selectedModel: string;
36export default function App() {
37const [config, setConfig] = useState<AppConfig>({
38anthropicApiKey: "",
39mcpServers: DEFAULT_MCP_SERVERS,
40selectedModel: "claude-3-5-sonnet-20241022",
45// Load config from localStorage on mount
46useEffect(() => {
47const savedApiKey = localStorage.getItem("anthropic_api_key");
48const savedMcpServers = localStorage.getItem("mcp_servers");
49const savedMessages = localStorage.getItem("chat_messages");
5152setConfig({
53anthropicApiKey: savedApiKey || "",
54mcpServers: savedMcpServers ? JSON.parse(savedMcpServers) : DEFAULT_MCP_SERVERS,
55selectedModel: savedModel || "claude-3-5-sonnet-20241022",
66}
6768// Show settings if no API key is configured
69if (!savedApiKey) {
70setShowSettings(true);
71}
74// Save config to localStorage when it changes
75useEffect(() => {
76if (config.anthropicApiKey) {
77localStorage.setItem("anthropic_api_key", config.anthropicApiKey);
78}
79localStorage.setItem("mcp_servers", JSON.stringify(config.mcpServers));